GHSA-27hp-xhwr-wr2m BIT-tomcat-2024-56337 CVE-2024-56337
Apache Tomcat Time-of-check Time-of-use (TOCTOU) Race Condition vulnerability
- Severity
- 0.0 / 10
- Critical · CVSS 4.0
- Exploit chance (EPSS)
- 8.97%
- Chance of exploitation in the next 30 days. Higher than 95.26% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition
- Fix
- Available
- 3 packages have a fixed version
Description
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 versions
Maven
| Package | Vulnerable | Fixed in |
|---|---|---|
| org.apache.tomcat.embed:tomcat-embed-core | >= 11.0.0-M1, < 11.0.2 |
11.0.2 |
| org.apache.tomcat.embed:tomcat-embed-core | >= 10.1.0-M1, < 10.1.34 |
10.1.34 |
| org.apache.tomcat.embed:tomcat-embed-core | >= 9.0.0.M1, < 9.0.98 |
9.0.98 |
| org.apache.tomcat:tomcat-catalina | >= 11.0.0-M1, < 11.0.2 |
11.0.2 |
| org.apache.tomcat:tomcat-catalina | >= 10.1.0-M1, < 10.1.34 |
10.1.34 |
| org.apache.tomcat:tomcat-embed-core | >= 9.0.0.M1, < 9.0.98 |
9.0.98 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
org.apache.tomcat.embed:tomcat-embed-core Maven → 11.0.2
- maven
<dependency><groupId>org.apache.tomcat.embed</groupId><artifactId>tomcat-embed-core</artifactId><version>11.0.2</version></dependency>- gradle
implementation("org.apache.tomcat.embed:tomcat-embed-core:11.0.2")
org.apache.tomcat:tomcat-catalina Maven → 11.0.2
- maven
<dependency><groupId>org.apache.tomcat</groupId><artifactId>tomcat-catalina</artifactId><version>11.0.2</version></dependency>- gradle
implementation("org.apache.tomcat:tomcat-catalina:11.0.2")
org.apache.tomcat:tomcat-embed-core Maven → 9.0.98
- maven
<dependency><groupId>org.apache.tomcat</groupId><artifactId>tomcat-embed-core</artifactId><version>9.0.98</version></dependency>- gradle
implementation("org.apache.tomcat:tomcat-embed-core:9.0.98")
Severity breakdown
CVSS 4.0 0.0
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- Present
- Privileges required
- None
- User interaction
- None
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- High
- Availability (vulnerable system)
- High
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
- Exploit maturity
- Unreported
CVSS 3.1 9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Weakness
CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.
How to prevent it
- Implementation: The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. This does not resolve the underlying issue of the execution of a function on a resource whose state and identity cannot be assured, but it does help to limit the false sense of security given by the check.
- Implementation: When the file being altered is owned by the current user and group, set the effective gid and uid to that of the current user and group when executing this statement.
- Architecture and Design: Limit the interleaving of operations on files from multiple processes.
- Implementation, Architecture and Design: If you cannot perform operations atomically and you must share access to the resource between multiple processes or threads, then try to limit the amount of time (CPU cycles) between the check and use of the resource. This will not fix the problem, but it could make it more difficult for an attack to succeed.
- Implementation: Recheck the resource after the use call to verify that the action was taken appropriately.
- Architecture and Design: Ensure that some environmental locking mechanism can be used to protect resources effectively.
- Implementation: Ensure that locking occurs before the check, as opposed to afterwards, such that the resource, as checked, is the same as it is when in use.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-83qj-6fr2-vhqg Apache Tomcat: Potential RCE and/or information disclosure and/or information corruption with partial PUT | Critical Known exploited | Also affects org.apache.tomcat.embed:tomcat-embed-core |
| GHSA-qppj-fm5r-hxr3 HTTP/2 Stream Cancellation Attack | Medium Known exploited | Also affects org.apache.tomcat.embed:tomcat-embed-core |
| GHSA-xjgh-84hx-56c5 Unrestricted Upload of File with Dangerous Type Apache Tomcat | High Known exploited | Also affects org.apache.tomcat.embed:tomcat-embed-core |
| GHSA-cw54-59pw-4g8c Apache Tomcat Improper Access Control vulnerability | Critical Known exploited | Also affects org.apache.tomcat:tomcat-catalina |
| CVE-2020-1938 Improper Privilege Management in Tomcat | Critical Known exploited | Also affects org.apache.tomcat.embed:tomcat-embed-core |
| GHSA-pjfr-qf3p-3q25 When running Apache Tomcat on Windows with HTTP PUTs enabled it was possible to upload a JSP file to the server | High Known exploited | Also affects org.apache.tomcat.embed:tomcat-embed-core |
| GHSA-h3x4-894j-xpx5 Apache Tomcat's FORM authentication process has an Incorrect Authorization vulnerability | Critical | Also affects org.apache.tomcat.embed:tomcat-embed-core |
| GHSA-9xv2-5v5q-p794 Apache Tomcat's DIGEST authenticator has an Authentication Bypass by Capture-replay vulnerability | Critical | Also affects org.apache.tomcat.embed:tomcat-embed-core |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor