Concurrent WebSocket Message Handling Vulnerability in Tomcat 9

tomcat9 Updated 02 Oct 2025

Summary

13/05/2022
N/A
Yes i
High
8.6

CVE-2022-25762: 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 wil... Affects tomcat9 across 2 version ranges.

< 9.0.22-1 >= e37b977db6f47e4380ad67114a49e8568951c953, < 67928399251771271d95a1805001ba00e650adce

Fixed in 9.0.22-1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Apache Tomcat is an open-source implementation of the Java Servlet, JavaServer Pages, and Java Expression Language technologies. It is widely used for deploying Java applications. Tomcat 9, in particular, introduced several enhancements over its predecessors, including improved performance and support for the latest Java standards. However, it is susceptible to a vulnerability that arises when WebSocket messages are sent while the connection is closing, potentially leading to data integrity issues.

Vulnerability Detail

The vulnerability, identified as CVE-2022-25762, occurs when a web application sends a WebSocket message concurrently with the closing of the WebSocket connection on Apache Tomcat versions 8.5.0 to 8.5.75 and 9.0.0.M1 to 9.0.20. This situation can lead to the application continuing to use a socket after it has been closed, resulting in error handling that may cause a pooled object to be placed in the pool twice. The implications include data being returned to the wrong user and other operational errors, which can severely affect the application's reliability and security.

How To Fix

Minimum fixed version

9.0.22-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade tomcat9

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can implement logic in your application to ensure that no WebSocket messages are sent during the closing phase of the connection. This can be achieved by adding checks in your WebSocket handling code to prevent message dispatching when the connection is in the process of closing.

Conclusion

CVE-2022-25762 is a significant vulnerability in Apache Tomcat that can lead to serious data integrity issues if not addressed. Users are strongly advised to upgrade to the latest version of Tomcat to mitigate the risks associated with this vulnerability. Implementing the recommended fixes and workarounds will help ensure the security and reliability of your applications.

See every vulnerability recorded for tomcat9 →

Share this vulnerability

FAQ

CVE-2022-25762 is a vulnerability in Apache Tomcat that allows for concurrent WebSocket message handling during connection closure, potentially leading to data integrity issues.

The vulnerability affects Apache Tomcat versions 8.5.0 to 8.5.75 and 9.0.0.M1 to 9.0.20.

The risks include data being returned to the wrong user and other operational errors, which can compromise the application's reliability and security.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for CVE-2022-25762 is 8.6, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for tomcat9.

How To Fix

Minimum fixed version

9.0.22-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade tomcat9

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback