CVE-2026-118436
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.
A denial of service vulnerability (CVE-2026-118436) has been identified in the CGI Servlet of Apache Tomcat, which allows attackers to tie up request-processing threads by sending POST requests without a declared content length, such as chunked requests, to a CGI script. The request body is also silently dropped, so the script never receives it.
Per OWASP: The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed.
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: >=11.0.0-M1 <=11.0.27, >=10.1.0-M1 <=10.1.61, >=9.0.0.M1 <=9.0.123, >=8.5.0 <=8.5.100, >=7.0.0 <=7.0.109
- 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
Vulnerability Info
This Medium-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. When the CGI Servlet runs a script, it builds the script's environment from the request. Because the CGI specification requires CONTENT_LENGTH to be empty or undefined when there is no content, the servlet sets it to an empty string whenever req.getContentLengthLong() returns 0 or less. That is also the case for a request that has a body but no Content-Length header, such as a POST sent with Transfer-Encoding: chunked:
long contentLength = req.getContentLengthLong();
String sContentLength = (contentLength <= 0 ? "" : Long.toString(contentLength));
envp.put("CONTENT_LENGTH", sContentLength);
CGIRunner.run() then starts the script process and uses that same variable to decide whether to write the request body to the script's standard input:
proc = rt.exec(cmdAndArgs.toArray(new String[0]), hashToStringArray(env), wd);
String sContentLength = env.get("CONTENT_LENGTH");
if (!"".equals(sContentLength)) {
commandsStdIn = new BufferedOutputStream(proc.getOutputStream());
IOTools.flow(stdin, commandsStdIn);
commandsStdIn.flush();
commandsStdIn.close();
}
When CONTENT_LENGTH is empty, the body is never copied and the process's standard input is never closed. A script that reads its standard input until end of file never sees one, so it keeps waiting, and the Tomcat worker thread that is waiting for the script's output and exit stays blocked with it. An attacker who can reach a CGI-mapped URL can repeat such requests to hold worker threads and script processes until the server can no longer serve legitimate requests.
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.