This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 4aee743d0c Require the request to the FORM login action to use HTTP
POST
4aee743d0c is described below
commit 4aee743d0cfc6f31633f6e6a937be9959c916d04
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 0a24de7fa5..4e28d2db28 100644
--- a/java/org/apache/catalina/authenticator/FormAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/FormAuthenticator.java
@@ -217,6 +217,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 5d03b54a13..10e6665c79 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -209,6 +209,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]