CVE-2022-23181: Apache Tomcat Race Condition Vulnerability
HIGHCVE-2022-23181 is a HIGH (CVSS 7.0) race condition vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Apache Tomcat libraries in the Maven ecosystem. The issue involves race condition in apache tomcat. Remediation is available by upgrading affected packages to version 10.0.16, 9.0.58, 8.5.75.
CVE-2022-23181 at a Glance
Security Impact
CVSS: 7.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-23181
To remediate this vulnerability, upgrade all affected Apache Tomcat dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>10.0.16</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>9.0.58</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>8.5.75</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.apache.tomcat
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-23181, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.tomcat
Analyze the terminal output to locate any version of Apache Tomcat in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.0.16), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.tomcat command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where 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. In Apache Tomcat, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-23181 Affected Apache Tomcat Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.tomcat:tomcat
|
Maven |
≥ 10.0.0
< 10.0.16
|
10.0.16
|
|
org.apache.tomcat:tomcat
|
Maven |
≥ 9.0.0
< 9.0.58
|
9.0.58
|
|
org.apache.tomcat:tomcat
|
Maven |
< 8.5.75
|
8.5.75
|
References
Frequently Asked Questions
What is CVE-2022-23181?
Which Apache Tomcat versions are affected?
What version fixes CVE-2022-23181?
Is tomcat affected?
What is the CVSS score of CVE-2022-23181?
What CWE is associated with CVE-2022-23181?
How can I check Maven dependencies for CVE-2022-23181?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9f3j-pm6f-9fm5",
"modified" : "2022-04-19T15:24:44Z",
"published" : "2022-02-01T00:45:44Z",
"aliases" : [ "CVE-2022-23181" ],
"summary" : "Race condition in Apache Tomcat",
"details" : "The fix for bug CVE-2020-9484 introduced a time of check time of use vulnerability into Apache Tomcat 10.1.0-M1 to 10.1.0-M8, 10.0.0-M5 to 10.0.14, 9.0.35 to 9.0.56 and 8.5.55 to 8.5.73 that allowed a local attacker to perform actions with the privileges of the user that the Tomcat process is using. This issue is only exploitable when Tomcat is configured to persist sessions using the FileStore.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat:tomcat"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "10.0.0"
}, {
"fixed" : "10.0.16"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat:tomcat"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.0.0"
}, {
"fixed" : "9.0.58"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat:tomcat"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "8.5.75"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-23181"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/tomcat"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread/l8x62p3k19yfcb208jo4zrb83k5mfwg9"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2022/10/msg00029.html"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20220217-0010"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2022/dsa-5265"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-367" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-31T19:06:23Z",
"nvd_published_at" : "2022-01-27T13:15:00Z"
}
}