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

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


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

commit 5eaee2271c7bd8c4fdadb77e42bc74f1884f8596
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 eca8ce4296..bdc5e72396 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 d54476c095..101a94bbed 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -324,6 +324,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