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

markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new acc382cd59 Require the request to the FORM login action to use HTTP 
POST
acc382cd59 is described below

commit acc382cd59019a96b0bfa46114af8917c8157fd2
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Sep 4 16:44:48 2026 +0100

    Require the request to the FORM login action to use HTTP POST
---
 java/org/apache/catalina/authenticator/FormAuthenticator.java | 4 ++++
 webapps/docs/changelog.xml                                    | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/java/org/apache/catalina/authenticator/FormAuthenticator.java 
b/java/org/apache/catalina/authenticator/FormAuthenticator.java
index 2e3ee1b9e9..4c02483493 100644
--- a/java/org/apache/catalina/authenticator/FormAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/FormAuthenticator.java
@@ -215,6 +215,10 @@ public class FormAuthenticator extends AuthenticatorBase {
 
         // Is this the action request from the login page?
         boolean loginAction = requestURI.startsWith(contextPath) && 
requestURI.endsWith(Constants.FORM_ACTION);
+        if (loginAction && !Method.POST.equals(request.getMethod())) {
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST);
+            return AuthenticationResult.FAILED;
+        }
 
         LoginConfig config = context.getLoginConfig();
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c19180414f..29c7ad8229 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -197,6 +197,10 @@
         Handle CGI scripts that write excessively to stdout after setting an
         HTTP error status code. (schultz)
       </fix>
+      <fix>
+        Require the request to the login action during FORM authentication to 
be
+        made using HTTP POST. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to