Skip to content

GHSA-h3ch-5pp2-vh6w BIT-tomcat-2022-25762 CVE-2022-25762

Improper socket reuse in Apache Tomcat

High Maven
Severity
8.6 / 10
High · CVSS 3.1
Exploit chance (EPSS)
8.40%
Chance of exploitation in the next 30 days. Higher than 94.99% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-404 Improper Resource Shutdown or Release
Fix
8.5.75
Upgrade org.apache.tomcat:tomcat to this version or later

Description

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.

Affected versions

Maven

PackageVulnerableFixed in
org.apache.tomcat:tomcat
>= 8.5.0, < 8.5.75
8.5.75
org.apache.tomcat:tomcat
>= 9.0.0M1, < 9.0.20
9.0.20

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:tomcat Maven → 8.5.75

maven
<dependency><groupId>org.apache.tomcat</groupId><artifactId>tomcat</artifactId><version>8.5.75</version></dependency>
gradle
implementation("org.apache.tomcat:tomcat:8.5.75")

Severity breakdown

CVSS 3.1 8.6

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
Low

Weakness

CWE-404: Improper Resource Shutdown or Release

The product does not release or incorrectly releases a resource before it is made available for re-use.

How to prevent it
  • Requirements: Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, languages such as Java, Ruby, and Lisp perform automatic garbage collection that releases memory for objects that have been deallocated.
  • Implementation: It is good practice to be responsible for freeing all resources you allocate and to be consistent with how and where you free memory in a function. If you allocate memory that you intend to free upon completion of the function, you must be sure to free the memory at all exit points for that function including error conditions.
  • Implementation: Memory should be allocated/freed using matching functions such as malloc/free, new/delete, and new[]/delete[].
  • Implementation: When releasing a complex object or structure, ensure that you properly dispose of all of its member components, not just the object itself.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-69r9-qgr7-g2wj
Apache Tomcat Missing Encryption of Sensitive Data vulnerability
High Known exploited Also affects org.apache.tomcat:tomcat
GHSA-h3x4-894j-xpx5
Apache Tomcat's FORM authentication process has an Incorrect Authorization vulnerability
Critical Also affects org.apache.tomcat:tomcat
GHSA-9xv2-5v5q-p794
Apache Tomcat's DIGEST authenticator has an Authentication Bypass by Capture-replay vulnerability
Critical Also affects org.apache.tomcat:tomcat
GHSA-gcx9-497g-6cp6
Apache Tomcat has an Improper Access Control, Incorrect Authorization vulnerability
Critical Also affects org.apache.tomcat:tomcat
GHSA-5m62-pw8w-7w9f
Apache Tomcat - Security constraints not correctly applied
Critical Also affects org.apache.tomcat:tomcat
GHSA-9m89-8frq-c98c
Apache Tomcat - AJP secret compared in non-constant time
Low Also affects org.apache.tomcat:tomcat
GHSA-5mp6-jrq3-r938
Apache Tomcat: LockOutRealm treats user names as case-sensitive
High Also affects org.apache.tomcat:tomcat
GHSA-h6fc-48rj-7qqh
Apache Tomcat - Digest authenticator will authenticate any unknown user
Critical Also affects org.apache.tomcat:tomcat
Is this in your code?

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