Apache Tomcat: Authentication bypass when using Jakarta Authentication API
Description
Unchecked Error Condition vulnerability in Apache Tomcat. If Tomcat is configured to use a custom Jakarta Authentication (formerly JASPIC) ServerAuthContext component which may throw an exception during the authentication process without explicitly setting an HTTP status to indicate failure, the authentication may not fail, allowing the user to bypass the authentication process. There are no known Jakarta Authentication components that behave in this way.
This issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.0-M26, from 10.1.0-M1 through 10.1.30, from 9.0.0-M1 through 9.0.95.
The following versions were EOL at the time the CVE was created but are known to be affected: 8.5.0 though 8.5.100. Other EOL versions may also be affected.
Users are recommended to upgrade to version 11.0.0, 10.1.31 or 9.0.96, which fix the issue.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Apache Tomcat authentication bypass via unchecked exception in custom Jakarta Authentication ServerAuthContext.
Vulnerability
Overview
CVE-2024-52316 is an unchecked error condition vulnerability in Apache Tomcat. When Tomcat is configured to use a custom Jakarta Authentication (formerly JASPIC) ServerAuthContext component that throws an exception during authentication without explicitly setting an HTTP status code to indicate failure, the authentication process may not fail. This allows an attacker to bypass authentication entirely. The root cause is that the Tomcat authentication code did not set a default error status when an exception was thrown by the ServerAuthContext.validateRequest() method [1][2].
Exploitation
Details
The vulnerability only occurs when a custom Jakarta Authentication ServerAuthContext is in use. Standard implementations do not exhibit this behavior; the advisory notes that there are no known Jakarta Authentication components that behave in this way [1][2]. An attacker must be able to trigger the exception condition in the custom component. The attack requires no special network position beyond normal HTTP access to the vulnerable application. Authentication bypass can occur without valid credentials.
Impact
Successful exploitation allows an attacker to bypass the authentication mechanism, gaining unauthorized access to protected resources. The impact is constrained by the fact that the vulnerable configuration (a custom ServerAuthContext that throws exceptions without setting an HTTP status) is rare and non-standard.
Mitigation
Apache Tomcat has fixed this issue in versions 11.0.0, 10.1.31, and 9.0.96 [1][2]. The fix explicitly sets an HTTP 500 (Internal Server Error) status when an AuthException is thrown during authentication [4]. Users are strongly recommended to upgrade to these patched versions. Affected versions include Tomcat 11.0.0-M1 through 11.0.0-M26, 10.1.0-M1 through 10.1.30, 9.0.0-M1 through 9.0.95, and the now-EOL 8.5.x branch [1][2].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.apache.tomcat:tomcat-catalinaMaven | < 9.0.96 | 9.0.96 |
org.apache.tomcat:tomcat-catalinaMaven | >= 10.1.0-M1, < 10.1.30 | 10.1.30 |
org.apache.tomcat:tomcat-catalinaMaven | >= 11.0.0-M1, < 11.0.1 | 11.0.1 |
Affected products
35- osv-coords34 versionspkg:bitnami/tomcatpkg:maven/org.apache.tomcat/tomcat-catalinapkg:rpm/almalinux/tomcatpkg:rpm/almalinux/tomcat-admin-webappspkg:rpm/almalinux/tomcat-docs-webapppkg:rpm/almalinux/tomcat-el-5.0-apipkg:rpm/almalinux/tomcat-jsp-3.1-apipkg:rpm/almalinux/tomcat-libpkg:rpm/almalinux/tomcat-servlet-6.0-apipkg:rpm/almalinux/tomcat-webappspkg:rpm/opensuse/tomcat10&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/tomcat10&distro=openSUSE%20Leap%2015.6pkg:rpm/opensuse/tomcat10&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/tomcat&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/tomcat&distro=openSUSE%20Leap%2015.6pkg:rpm/opensuse/tomcat&distro=openSUSE%20Tumbleweedpkg:rpm/suse/tomcat10&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP5pkg:rpm/suse/tomcat10&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP6pkg:rpm/suse/tomcat&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-ESPOSpkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-LTSSpkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP5pkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Web%20and%20Scripting%2015%20SP6pkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5-LTSSpkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP4-LTSSpkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP4pkg:rpm/suse/tomcat&distro=SUSE%20Linux%20Enterprise%20Server%20LTSS%20Extended%20Security%2012%20SP5pkg:rpm/suse/tomcat&distro=SUSE%20Manager%20Server%204.3
>= 9.0.0, < 9.0.96+ 33 more
- (no CPE)range: >= 9.0.0, < 9.0.96
- (no CPE)range: < 9.0.96
- (no CPE)range: < 1:10.1.36-1.el10_0
- (no CPE)range: < 1:10.1.36-1.el10_0
- (no CPE)range: < 1:10.1.36-1.el10_0
- (no CPE)range: < 1:10.1.36-1.el10_0
- (no CPE)range: < 1:10.1.36-1.el10_0
- (no CPE)range: < 1:10.1.36-1.el10_0
- (no CPE)range: < 1:10.1.36-1.el10_0
- (no CPE)range: < 1:10.1.36-1.el10_0
- (no CPE)range: < 10.1.33-150200.5.28.1
- (no CPE)range: < 10.1.33-150200.5.28.1
- (no CPE)range: < 10.1.33-1.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-1.1
- (no CPE)range: < 10.1.33-150200.5.28.1
- (no CPE)range: < 10.1.33-150200.5.28.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.36-3.133.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.97-150200.71.1
- (no CPE)range: < 9.0.36-3.133.1
- (no CPE)range: < 9.0.97-150200.71.1
- Apache Software Foundation/Apache Tomcatv5Range: 11.0.0-M1
Patches
3acc2f01395f8If the Jakarta Authentication fails with an exception, set a 500 status
2 files changed · +7 −0
java/org/apache/catalina/authenticator/AuthenticatorBase.java+2 −0 modified@@ -803,6 +803,8 @@ private boolean authenticateJaspic(Request request, Response response, JaspicSta authStatus = state.serverAuthContext.validateRequest(state.messageInfo, client, null); } catch (AuthException e) { log.debug(sm.getString("authenticator.loginFail"), e); + // Need to explicitly set the return code as the ServerAuthContext may not have done. + response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return false; }
webapps/docs/changelog.xml+5 −0 modified@@ -117,6 +117,11 @@ creates one <code>GenericPrincipal</code> in the <code>Subject</code>. (markt) </fix> + <fix> + If the Jakarta Authentication process fails with an Exception, + explicitly set the HTTP response status to 500 as the + <code>ServerAuthContext</code> may not have set it. (markt) + </fix> </changelog> </subsection> </section>
7532f9dc4a8cIf the Jakarta Authentication fails with an exception, set a 500 status
2 files changed · +7 −0
java/org/apache/catalina/authenticator/AuthenticatorBase.java+2 −0 modified@@ -802,6 +802,8 @@ private boolean authenticateJaspic(Request request, Response response, JaspicSta authStatus = state.serverAuthContext.validateRequest(state.messageInfo, client, null); } catch (AuthException e) { log.debug(sm.getString("authenticator.loginFail"), e); + // Need to explicitly set the return code as the ServerAuthContext may not have done. + response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return false; }
webapps/docs/changelog.xml+5 −0 modified@@ -112,6 +112,11 @@ creates one <code>GenericPrincipal</code> in the <code>Subject</code>. (markt) </fix> + <fix> + If the Jakarta Authentication process fails with an Exception, + explicitly set the HTTP response status to 500 as the + <code>ServerAuthContext</code> may not have set it. (markt) + </fix> </changelog> </subsection> </section>
6d097a667466If the Jakarta Authentication fails with an exception, set a 500 status
2 files changed · +7 −0
java/org/apache/catalina/authenticator/AuthenticatorBase.java+2 −0 modified@@ -803,6 +803,8 @@ private boolean authenticateJaspic(Request request, Response response, JaspicSta authStatus = state.serverAuthContext.validateRequest(state.messageInfo, client, null); } catch (AuthException e) { log.debug(sm.getString("authenticator.loginFail"), e); + // Need to explicitly set the return code as the ServerAuthContext may not have done. + response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return false; }
webapps/docs/changelog.xml+5 −0 modified@@ -117,6 +117,11 @@ creates one <code>GenericPrincipal</code> in the <code>Subject</code>. (markt) </fix> + <fix> + If the Jakarta Authentication process fails with an Exception, + explicitly set the HTTP response status to 500 as the + <code>ServerAuthContext</code> may not have set it. (markt) + </fix> </changelog> </subsection> </section>
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
9- github.com/advisories/GHSA-xcpr-7mr4-h4xqghsaADVISORY
- lists.apache.org/thread/lopzlqh91jj9n334g02om08sbysdb928ghsavendor-advisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2024-52316ghsaADVISORY
- www.openwall.com/lists/oss-security/2024/11/18/2ghsaWEB
- github.com/apache/tomcat/commit/6d097a66746635df6880fe7662a792156b0eca14ghsaWEB
- github.com/apache/tomcat/commit/7532f9dc4a8c37ec958f79dc82c4924a6c539223ghsaWEB
- github.com/apache/tomcat/commit/acc2f01395f895980f5d8a64573fcc1bade13369ghsaWEB
- lists.debian.org/debian-lts-announce/2025/01/msg00009.htmlghsaWEB
- security.netapp.com/advisory/ntap-20250124-0003ghsaWEB
News mentions
0No linked articles in our index yet.