Vulnerability · Published Oct 14, 2021 · Assigned by apache
CVE-2021-42340DoS via memory leak with WebSocket connections
High 7.5
In plain English
A high-severity security flaw in Apache Tomcat from Apache Software Foundation. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 11.8% (higher than 96% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
The fix for bug 63362 present in Apache Tomcat 10.1.0-M1 to 10.1.0-M5, 10.0.0-M1 to 10.0.11, 9.0.40 to 9.0.53 and 8.5.60 to 8.5.71 introduced a memory leak. The object introduced to collect metrics for HTTP upgrade connections was not released for WebSocket connections once the connection was closed. This created a memory leak that, over time, could lead to a denial of service via an OutOfMemoryError.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | tomcat9 | 9.0.54-1 | DEBIAN-CVE-2021-42340 |
| Debian:13 | tomcat9 | 9.0.54-1 | DEBIAN-CVE-2021-42340 |
| Debian:14 | tomcat9 | 9.0.54-1 | DEBIAN-CVE-2021-42340 |
| Maven | org.apache.tomcat:tomcat | 8.5.72 | GHSA-wph7-x527-w3h5 |
| Maven | org.apache.tomcat:tomcat | 10.1.0-M6 | GHSA-wph7-x527-w3h5 |
| Maven | org.apache.tomcat:tomcat | 10.0.12 | GHSA-wph7-x527-w3h5 |
| Maven | org.apache.tomcat:tomcat | 9.0.54 | GHSA-wph7-x527-w3h5 |
| Ubuntu:22.04:LTS | tomcat9 | no fix listed | UBUNTU-CVE-2021-42340 |
| Ubuntu:24.04:LTS | tomcat9 | no fix listed | UBUNTU-CVE-2021-42340 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Apache Software Foundation | Apache Tomcat | Apache Tomcat 10 10.0.0-M10 to 10.0.11Apache Tomcat 10 10.1.0-M1 to 10.1.0-M5Apache Tomcat 9 9.0.40 to 9.0.53Apache Tomcat 8 8.5.60 to 8.5.71 |
Weakness: CWE-772
References
- https://lists.apache.org/thread.html/r83a35be60f06aca2065f188ee542b9099695d57ced2e70e0885f905c%40%3Cannounce.tomcat.apache.org%3E x_refsource_MISC
- [myfaces-commits] 20211021 [myfaces-tobago] branch tobago-5.x updated: build: workaround for CVE-2021-42340 mailing-list, x_refsource_MLIST
- DSA-5009 vendor-advisory, x_refsource_DEBIAN
- https://www.oracle.com/security-alerts/cpujan2022.html x_refsource_MISC
- https://security.netapp.com/advisory/ntap-20211104-0001/ x_refsource_CONFIRM
- https://kc.mcafee.com/corporate/index?page=content&id=SB10379 x_refsource_CONFIRM
- https://www.oracle.com/security-alerts/cpuapr2022.html x_refsource_MISC
- https://www.oracle.com/security-alerts/cpujul2022.html x_refsource_MISC
- GLSA-202208-34 vendor-advisory, x_refsource_GENTOO