Cloudanix VulnDB

CVE-2024-56337

None

Apache Tomcat Time-of-check Time-of-use (TOCTOU) Race Condition vulnerability

CVSS

—

EPSS

9.0%

Published

Dec 20, 2024

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A misconfigured vulnerable Tomcat server can let an attacker upload a file that the server then runs, potentially giving them control of the application server.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Moderate
Impact
Remote Code Execution
Component
Web Framework
Class
Race Condition
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

This vulnerability is a time-of-check/time-of-use race condition in Apache Tomcat related to the incomplete mitigation for CVE-2024-50379. It affects Tomcat 11.0.0-M1 through 11.0.1, 10.1.0-M1 through 10.1.33, and 9.0.0.M1 through 9.0.97 when Tomcat is deployed on a case-insensitive file system and the default servlet is configured with write access enabled by setting the non-default readonly parameter to false. Under affected conditions, Java canonical path caching can allow Tomcat security checks to make decisions on stale or inconsistent path resolution results. An attacker who can write content through the default servlet may be able to win a race using path case variations and cause a server-side file, commonly a JSP, to be written and later executed, resulting in remote code execution in the context of the Tomcat process.

Why it matters to the business

Successful exploitation can allow an unauthenticated or low-privileged remote attacker, depending on application exposure and configuration, to place executable content on the web server and run commands with the privileges of the Tomcat service account. Business consequences may include web application takeover, data theft, credential compromise, service disruption, lateral movement from the application server, and deployment of web shells or malware. The issue is not currently listed in CISA KEV and the provided exploit maturity is none, but the EPSS value indicates non-trivial exploitation interest, and Tomcat vulnerabilities have been actively targeted in broader 2025 malware and vulnerability-trend reporting. Because the issue has been public for an extended period, internet-facing Tomcat systems with writable default servlet configurations should be treated as higher priority even without KEV status.

How an attack unfolds

An attacker first identifies a Tomcat instance running an affected version and determines whether the default servlet permits write operations, typically by probing for HTTP PUT behavior. The attacker then checks whether the deployment characteristics are favorable, especially a case-insensitive file system such as many Windows deployments and a Java runtime where sun.io.useCanonCaches remains enabled or improperly configured. The attacker repeatedly sends write requests using path and filename case variations to exploit the race between Tomcat's path validation and file use. If the race succeeds, attacker-controlled server-side content, often a JSP payload, is written into a web-accessible location. The attacker then requests the uploaded JSP or equivalent resource over HTTP, causing Tomcat to execute it. Post-exploitation activity commonly includes command execution, web shell staging, credential discovery, persistence, and attempts to move further into the environment.

How to fix it

Upgrade Apache Tomcat to a fixed release: Tomcat 11.0.3 or later, 10.1.35 or later, or 9.0.99 or later. For source-based deployments, the provided fixed Tomcat Git commit is 727a8467a37e17fef91e12a65db4d56862d36171. If immediate upgrade is not possible, disable write access in the default servlet by ensuring the readonly initialization parameter is not set to false; the safe default is readonly=true. On Java 8 and Java 11, explicitly set -Dsun.io.useCanonCaches=false. On Java 17, ensure sun.io.useCanonCaches is either unset or set to false. On Java 21 and later, the problematic cache has been removed, but upgrading Tomcat is still recommended because fixed Tomcat versions add configuration checks before allowing writable default servlet behavior on case-insensitive file systems. Restrict or block HTTP methods not required by the application, especially PUT, DELETE, and WebDAV-like write behavior. Review package inventory carefully because the supplied affected-product data includes a qemu Ubuntu 14.04 LTS package mapping that does not align with the Tomcat vulnerability description; validate vendor advisories before treating non-Tomcat package entries as applicable to this CVE.

How to confirm the fix worked

Confirm the running Tomcat version is 11.0.3 or later, 10.1.35 or later, or 9.0.99 or later. Review Tomcat configuration for the default servlet and verify readonly is absent or set to true; any readonly=false configuration should be considered exposed unless there is a specific compensating control and a fixed Tomcat version. Check JVM startup arguments and runtime properties for sun.io.useCanonCaches; Java 8 and Java 11 deployments should explicitly show false, Java 17 should not show true, and Java 21 or later removes the affected cache behavior. Confirm the host file system used for deployed web applications is not case-insensitive or, if it is, that all required Tomcat and Java mitigations are present. Perform a controlled validation in a non-production or approved test path to verify that HTTP PUT cannot create files in web-accessible directories and that attempts to upload JSP or server-executable content are rejected. Review access logs after remediation to confirm write methods are blocked or return expected denial status codes.

Typical attack path

  1. Fingerprint exposed Apache Tomcat services and identify affected version ranges: 11.0.0-M1 through 11.0.1, 10.1.0-M1 through 10.1.33, or 9.0.0.M1 through 9.0.97.
  2. Probe whether the default servlet accepts write methods such as PUT, indicating readonly=false or an equivalent unsafe configuration.
  3. Determine or infer whether the server runs on a case-insensitive file system and a Java version/configuration where canonical path caching may be active.
  4. Send repeated HTTP write requests using filename or path case variations to trigger the race condition.
  5. Write attacker-controlled executable content, commonly a JSP file, into a web-accessible application directory.
  6. Request the uploaded file to execute code under the Tomcat process identity.
  7. Use the achieved execution path for web shell access, credential harvesting, persistence, data access, or lateral movement.

How to detect it

To determine whether exploitation already occurred, review Tomcat access logs, reverse proxy logs, WAF logs, endpoint telemetry, file integrity monitoring, and process creation records. Focus on HTTP PUT, DELETE, or unusual write-method requests to application paths, especially requests involving .jsp, mixed-case file extensions, encoded path separators, or repeated requests to the same filename with different casing. Look for subsequent GET or POST requests to newly created JSP files that were not part of normal deployments. On the host, inspect Tomcat web application directories for recently modified JSP, JSPX, class, WAR, or unexpected text files, particularly under webapps, webapps/ROOT, manager-deployed applications, and exploded application directories. Review Tomcat temporary and work directories for generated classes corresponding to suspicious JSP names. Endpoint detection should look for the Tomcat Java process spawning shells or system utilities such as cmd.exe, powershell.exe, sh, bash, curl, wget, certutil, whoami, id, net, or netstat. Correlate activity with known broader Tomcat exploitation campaigns and malware-trend reporting, but do not assume named threat-actor attribution without corroborating infrastructure, malware, or tradecraft evidence.

  • readonly="false"
  • readonly=false
  • sun.io.useCanonCaches=true
  • -Dsun.io.useCanonCaches=true
  • PUT /
  • DELETE /
  • PUT /.jsp
  • PUT .jsp
  • PUT .JSP
  • PUT .Jsp
  • GET /.jsp
  • POST /.jsp
  • /webapps/ROOT/*.jsp
  • /webapps/*/*.jsp
  • /work/Catalina/localhost/
  • org.apache.catalina.startup.Bootstrap
  • java.exe -> cmd.exe
  • java.exe -> powershell.exe
  • java -> /bin/sh
  • java -> /bin/bash
  • cmd.exe /c whoami
  • powershell.exe -enc
  • curl http://
  • wget http://
  • certutil -urlcache

What your security team should do

  • Prioritize internet-facing Tomcat instances and any Tomcat deployments on Windows or other case-insensitive file systems.
  • Upgrade affected Tomcat branches to 11.0.3+, 10.1.35+, or 9.0.99+ as the preferred remediation.
  • Immediately remove unsafe default servlet write access by changing readonly=false to readonly=true or removing the non-default setting.
  • For Java 8 and Java 11, set -Dsun.io.useCanonCaches=false and restart Tomcat; for Java 17, verify it is not set to true.
  • Block unnecessary HTTP write methods at the reverse proxy, load balancer, WAF, or application server layer, especially PUT and DELETE.
  • Hunt for historical HTTP PUT requests, newly created JSP files, suspicious files in web application directories, and Tomcat child processes spawning operating-system shells.
  • Treat signs of uploaded JSP execution or Tomcat-launched command interpreters as potential compromise and initiate incident response.
  • Validate software inventory results because unrelated package mappings may appear in some vulnerability feeds; confirm applicability against Apache Tomcat vendor guidance.

The record

Time-of-check Time-of-use (TOCTOU) Race Condition vulnerability in Apache Tomcat. This issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.1, from 10.1.0-M1 through 10.1.33, from 9.0.0.M1 through 9.0.97. The mitigation for CVE-2024-50379 was incomplete. Users running Tomcat on a case insensitive file system with the default servlet write enabled (readonly initialisation parameter set to the non-default value of false) may need additional configuration to fully mitigate CVE-2024-50379 depending on which version of Java they are using with Tomcat: - running on Java 8 or Java 11: the system property sun.io.useCanonCaches must be explicitly set to false (it defaults to true) - running on Java 17: the system property sun.io.useCanonCaches, if set, must be set to false (it defaults to false) - running on Java 21 onwards: no further configuration is required (the system property and the problematic cache have been removed) Tomcat 11.0.3, 10.1.35 and 9.0.99 onwards will include checks that sun.io.useCanonCaches is set appropriately before allowing the default servlet to be write enabled on a case insensitive file system. Tomcat will also set sun.io.useCanonCaches to false by default where it can.

Affected packages

Ecosystem Package Introduced Fixed
Maven org.apache.tomcat.embed:tomcat-embed-core 10.1.0-M1 10.1.34
Maven org.apache.tomcat.embed:tomcat-embed-core 11.0.0-M1 11.0.2
Maven org.apache.tomcat.embed:tomcat-embed-core 9.0.0.M1 9.0.98
Maven org.apache.tomcat:tomcat-catalina 10.1.0-M1 10.1.34
Maven org.apache.tomcat:tomcat-catalina 11.0.0-M1 11.0.2
Maven org.apache.tomcat:tomcat-embed-core 9.0.0.M1 9.0.98
AlmaLinux:10 tomcat9 0 1:9.0.87-5.el10_0.1
AlmaLinux:10 tomcat9-admin-webapps 0 1:9.0.87-5.el10_0.1
AlmaLinux:10 tomcat9-docs-webapp 0 1:9.0.87-5.el10_0.1
AlmaLinux:10 tomcat9-el-3.0-api 0 1:9.0.87-5.el10_0.1
AlmaLinux:10 tomcat9-jsp-2.3-api 0 1:9.0.87-5.el10_0.1
AlmaLinux:10 tomcat9-lib 0 1:9.0.87-5.el10_0.1
AlmaLinux:10 tomcat9-servlet-4.0-api 0 1:9.0.87-5.el10_0.1
AlmaLinux:10 tomcat9-webapps 0 1:9.0.87-5.el10_0.1
AlmaLinux:8 tomcat 0 1:9.0.87-1.el8_10.4
AlmaLinux:8 tomcat-admin-webapps 0 1:9.0.87-1.el8_10.4
AlmaLinux:8 tomcat-docs-webapp 0 1:9.0.87-1.el8_10.4
AlmaLinux:8 tomcat-el-3.0-api 0 1:9.0.87-1.el8_10.4
AlmaLinux:8 tomcat-jsp-2.3-api 0 1:9.0.87-1.el8_10.4
AlmaLinux:8 tomcat-lib 0 1:9.0.87-1.el8_10.4
AlmaLinux:8 tomcat-servlet-4.0-api 0 1:9.0.87-1.el8_10.4
AlmaLinux:8 tomcat-webapps 0 1:9.0.87-1.el8_10.4
AlmaLinux:9 tomcat 0 1:9.0.87-3.el9_6.1
AlmaLinux:9 tomcat-admin-webapps 0 1:9.0.87-3.el9_6.1
AlmaLinux:9 tomcat-docs-webapp 0 1:9.0.87-3.el9_6.1
AlmaLinux:9 tomcat-el-3.0-api 0 1:9.0.87-3.el9_6.1
AlmaLinux:9 tomcat-jsp-2.3-api 0 1:9.0.87-3.el9_6.1
AlmaLinux:9 tomcat-lib 0 1:9.0.87-3.el9_6.1
AlmaLinux:9 tomcat-servlet-4.0-api 0 1:9.0.87-3.el9_6.1
AlmaLinux:9 tomcat-webapps 0 1:9.0.87-3.el9_6.1
Bitnami tomcat 0 9.0.98
Bitnami tomcat 11.0.0 11.0.2
Bitnami tomcat 9.0.0 9.0.98
Chainguard camunda-zeebe 0 8.6.6-r2
Chainguard camunda-zeebe-compat 0 8.6.6-r2
Chainguard thingsboard 0 3.9-r1
Chainguard thingsboard-tb-js-executor 0 3.9-r1
Chainguard thingsboard-tb-mqtt-transport 0 3.9-r1
Chainguard thingsboard-tb-node 0 3.9-r1
Chainguard thingsboard-tb-web-ui 0 3.9-r1
Debian:11 tomcat9 0 No fix
Debian:11 tomcat9 0 9.0.43-2~deb11u11
Debian:12 tomcat10 0 No fix
Debian:12 tomcat10 0 10.1.34-0+deb12u1
Debian:12 tomcat9 0 9.0.70-2
Debian:13 tomcat10 0 No fix
Debian:13 tomcat9 0 9.0.70-2
SUSE:Enterprise Storage 7.1 tomcat 0 9.0.98-150200.74.1
SUSE:Enterprise Storage 7.1 tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS tomcat10 0 10.1.34-150200.5.31.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS tomcat10 0 10.1.39-150200.5.36.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS tomcat10 0 10.1.34-150200.5.31.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS tomcat10 0 10.1.39-150200.5.36.1
SUSE:Linux Enterprise Module for Web and Scripting 15 SP6 tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise Module for Web and Scripting 15 SP6 tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise Module for Web and Scripting 15 SP6 tomcat10 0 10.1.34-150200.5.31.1
SUSE:Linux Enterprise Module for Web and Scripting 15 SP6 tomcat10 0 10.1.39-150200.5.36.1
SUSE:Linux Enterprise Server 15 SP3-LTSS tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise Server 15 SP3-LTSS tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise Server 15 SP4-LTSS tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise Server 15 SP4-LTSS tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise Server 15 SP5-LTSS tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise Server 15 SP5-LTSS tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise Server 15 SP5-LTSS tomcat10 0 10.1.34-150200.5.31.1
SUSE:Linux Enterprise Server 15 SP5-LTSS tomcat10 0 10.1.39-150200.5.36.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP5 tomcat 0 9.0.98-150200.74.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP5 tomcat 0 9.0.102-150200.78.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP5 tomcat10 0 10.1.34-150200.5.31.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP5 tomcat10 0 10.1.39-150200.5.36.1
SUSE:Manager Server 4.3 tomcat 0 9.0.98-150200.74.1
SUSE:Manager Server 4.3 tomcat 0 9.0.102-150200.78.1
Ubuntu:16.04:LTS tomcat6 0 No fix
Ubuntu:20.04:LTS tomcat9 0 No fix
Ubuntu:22.04:LTS tomcat9 0 No fix
Ubuntu:24.04:LTS tomcat10 0 No fix
Ubuntu:24.04:LTS tomcat9 0 No fix
Ubuntu:24.10 tomcat10 0 No fix
Ubuntu:24.10 tomcat9 0 No fix
Ubuntu:Pro:14.04:LTS tomcat6 0 No fix
Ubuntu:Pro:14.04:LTS tomcat7 0 No fix
Ubuntu:Pro:16.04:LTS tomcat6 0 No fix
Ubuntu:Pro:16.04:LTS tomcat7 0 No fix
Ubuntu:Pro:16.04:LTS tomcat8 0 No fix
Ubuntu:Pro:18.04:LTS tomcat7 0 No fix
Ubuntu:Pro:18.04:LTS tomcat8 0 No fix
Ubuntu:Pro:18.04:LTS tomcat9 0 No fix
Ubuntu:Pro:20.04:LTS tomcat9 0 No fix
Ubuntu:Pro:22.04:LTS tomcat9 0 No fix
Wolfi thingsboard 0 3.9-r1
Wolfi thingsboard-tb-js-executor 0 3.9-r1
Wolfi thingsboard-tb-mqtt-transport 0 3.9-r1
Wolfi thingsboard-tb-node 0 3.9-r1
Wolfi thingsboard-tb-web-ui 0 3.9-r1
maven org.apache.tomcat.embed/tomcat-embed-core 10.1.0-M1 10.1.34
maven org.apache.tomcat.embed/tomcat-embed-core 11.0.0-M1 11.0.2
maven org.apache.tomcat.embed/tomcat-embed-core 9.0.0.M1 9.0.98
maven org.apache.tomcat/tomcat-catalina 10.1.0-M1 10.1.34
maven org.apache.tomcat/tomcat-catalina 11.0.0-M1 11.0.2
maven org.apache.tomcat/tomcat-catalina 9.0.0.M1 9.0.98
maven org.apache.tomcat/tomcat-embed-core 9.0.0.M1 9.0.98
openSUSE:Leap 15.6 tomcat 0 9.0.98-150200.74.1
openSUSE:Leap 15.6 tomcat 0 9.0.102-150200.78.1
openSUSE:Leap 15.6 tomcat10 0 10.1.34-150200.5.31.1
openSUSE:Leap 15.6 tomcat10 0 10.1.39-150200.5.36.1
openSUSE:Tumbleweed tomcat 0 9.0.99-1.1
openSUSE:Tumbleweed tomcat10 0 10.1.35-1.1

Related vulnerabilities