You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2020/02/27 09:28:37 UTC

[tomcat] branch 9.0.x updated: Ignore zero length secret

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new f30d7cd  Ignore zero length secret
f30d7cd is described below

commit f30d7cd8979d340d062d26a9b1dc896b51f481f9
Author: remm <re...@apache.org>
AuthorDate: Thu Feb 27 10:27:20 2020 +0100

    Ignore zero length secret
    
    No doc fix needed, secretRequired was already well described.
---
 java/org/apache/coyote/ajp/AjpProcessor.java | 4 ++--
 webapps/docs/changelog.xml                   | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java
index 7bbdf0a..9788b6e 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -851,7 +851,7 @@ public class AjpProcessor extends AbstractProcessor {
 
             case Constants.SC_A_SECRET:
                 requestHeaderMessage.getBytes(tmpMB);
-                if (secret != null) {
+                if (secret != null && secret.length() > 0) {
                     secretPresentInRequest = true;
                     if (!tmpMB.equals(secret)) {
                         response.setStatus(403);
@@ -869,7 +869,7 @@ public class AjpProcessor extends AbstractProcessor {
         }
 
         // Check if secret was submitted if required
-        if ((secret != null) && !secretPresentInRequest) {
+        if (secret != null && secret.length() > 0 && !secretPresentInRequest) {
             response.setStatus(403);
             setErrorState(ErrorState.CLOSE_CLEAN, null);
         }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ae28665..85be0e1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -94,6 +94,10 @@
         Add the TLS request attributes used by IIS to the attributes that an AJP
         Connector will always accept. (markt)
       </fix>
+      <fix>
+        A zero length AJP secret will now behave as if it has not been
+        specified. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org