This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new e544be019d Require the request to the FORM login action to use HTTP
POST
e544be019d is described below
commit e544be019d44dec00fb7f9a81be86243c00959d8
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 3231f70b0e..0ca80a3bd2 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 c92515d7d8..53543b7a62 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -185,6 +185,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]