CVE-2022-25762: Apache Tomcat Improper Socket Reuse Vulnerability
HIGHCVE-2022-25762 is a HIGH (CVSS 8.6) improper socket reuse vulnerability (CWE-404: Improper Resource Shutdown or Release) affecting Apache Tomcat libraries in the Maven ecosystem. The issue involves improper socket reuse in apache tomcat. Remediation is available by upgrading affected packages to version 8.5.75, 9.0.20.
CVE-2022-25762 at a Glance
Security Impact
CVSS: 8.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L).
How to Fix CVE-2022-25762
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>8.5.75</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>9.0.20</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-25762, 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 8.5.75), 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-404: Improper Resource Shutdown or Release, where the product does not release or incorrectly releases a resource before it is made available for re-use. 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-25762 Affected Apache Tomcat Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.tomcat:tomcat
|
Maven |
≥ 8.5.0
< 8.5.75
|
8.5.75
|
|
org.apache.tomcat:tomcat
|
Maven |
≥ 9.0.0M1
< 9.0.20
|
9.0.20
|
References
Frequently Asked Questions
What is CVE-2022-25762?
Which Apache Tomcat versions are affected?
What version fixes CVE-2022-25762?
Is tomcat affected?
What is the CVSS score of CVE-2022-25762?
What CWE is associated with CVE-2022-25762?
How can I check Maven dependencies for CVE-2022-25762?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h3ch-5pp2-vh6w",
"modified" : "2022-05-25T22:52:21Z",
"published" : "2022-05-14T00:01:50Z",
"aliases" : [ "CVE-2022-25762" ],
"summary" : "Improper socket reuse in Apache Tomcat",
"details" : "If a web application sends a WebSocket message concurrently with the WebSocket connection closing when running on Apache Tomcat 8.5.0 to 8.5.75 or Apache Tomcat 9.0.0.M1 to 9.0.20, it is possible that the application will continue to use the socket after it has been closed. The error handling triggered in this case could cause the a pooled object to be placed in the pool twice. This could result in subsequent connections using the same object concurrently which could result in data being returned to the wrong use and/or other errors.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat:tomcat"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.5.0"
}, {
"fixed" : "8.5.75"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat:tomcat"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.0.0M1"
}, {
"fixed" : "9.0.20"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-25762"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/tomcat"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread/6ckmjfb1k61dyzkto9vm2k5jvt4o7w7c"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20220629-0003"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-404" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-05-25T22:52:21Z",
"nvd_published_at" : "2022-05-13T08:15:00Z"
}
}