CVE-2026-121649
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Apache Tomcat is an open-source implementation of the Jakarta Servlet, Jakarta Pages, Jakarta Expression Language, Jakarta WebSocket, Jakarta Annotations, and Jakarta Authentication specifications. It serves Java web applications either as a standalone servlet container and HTTP server or embedded inside an application through the tomcat-embed-core artifact. Its Catalina servlet container (org.apache.tomcat:tomcat-catalina) supplies the request-processing pipeline, including Valves such as RewriteValve, along with connectors, realms, and session management.
An information exposure vulnerability (CVE-2026-121649) has been identified in the ExpiresFilter of Apache Tomcat, which allows attackers to obtain authenticated responses from a shared cache. When the filter adds its max-age directive, it replaces any Cache-Control value set before it ran, such as the private directive the authentication layer sets on protected resources, so a proxy or other shared cache may store a user's protected response and serve it to other clients.
Per OWASP: Access control enforces policy such that users cannot act outside of their intended permissions. Failures typically lead to unauthorized information disclosure, modification, or destruction of all data or performing a business function outside the user's limits.
This issue affects multiple versions of Apache Tomcat.
Details
Module Info
- Product: Apache Tomcat
- Affected packages:
org.apache.tomcat:tomcat-catalina,org.apache.tomcat.embed:tomcat-embed-core - Affected versions: >=7.0.1 <=7.0.109, >=8.5.0 <=8.5.100, >=9.0.0.M1 <=9.0.123, >=10.1.0-M1 <=10.1.61, >=11.0.0-M1 <=11.0.27
- GitHub repository: https://github.com/apache/tomcat
- Published packages: https://central.sonatype.com/artifact/org.apache.tomcat/tomcat-catalina, https://central.sonatype.com/artifact/org.apache.tomcat.embed/tomcat-embed-core
- Package manager: Maven
- Fixed in:
- OSS Apache Tomcat 9.0.124, 10.1.62, 11.0.29
- NES for Apache Tomcat
Vulnerability Info
This High-severity vulnerability is found in the org.apache.tomcat:tomcat-catalina and org.apache.tomcat.embed:tomcat-embed-core packages in multiple versions of Apache Tomcat. ExpiresFilter wraps the response in an XHttpServletResponse that keeps its own copy of the Cache-Control header. The wrapper only records values that are set through its own addHeader and setHeader overrides, and it never reads the headers that were already present on the wrapped response when the filter started:
@Override
public void addHeader(String name, String value) {
super.addHeader(name, value);
if (HEADER_CACHE_CONTROL.equalsIgnoreCase(name) && cacheControlHeader == null) {
cacheControlHeader = value;
}
}
public String getCacheControlHeader() {
return cacheControlHeader;
}
Before the response body is written, onBeforeWriteResponseBody builds the new header from that local copy and writes it back with setHeader, which replaces every existing Cache-Control value on the underlying response:
String cacheControlHeader = response.getCacheControlHeader();
String newCacheControlHeader =
(cacheControlHeader == null) ? maxAgeDirective : cacheControlHeader + ", " + maxAgeDirective;
response.setHeader(HEADER_CACHE_CONTROL, newCacheControlHeader);
response.setDateHeader(HEADER_EXPIRES, expirationDate.getTime());
Tomcat's authenticators run before the filter chain and, with the default disableProxyCaching setting, add Cache-Control: private to responses for protected resources. Because the wrapper's copy is still null for such a response, the filter replaces that directive with a bare max-age=<seconds> value and also adds an Expires header. The same blind spot means the eligibility check, which looks for an existing max-age directive only in the wrapper's copy, does not see a max-age directive set earlier in the chain. A response that was marked private to the authenticated user is therefore sent as publicly cacheable, and an intermediate cache can serve that user's content to anyone who requests the same URL.
Mitigation
Only recent versions of Apache Tomcat are community-supported. The community support version will not receive any updates to address this issue. For more information, see here.
Users of the affected components should apply one of the following mitigations:
- Upgrade to a patched version of Apache Tomcat.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
- Charlie Eriksen from Aikido Security (finder)