CVE-2021-42340DoS via memory leak with WebSocket connections
- 7.5HighCVSS base score
- 11.8%Exploitation in 30 daysEPSS · top 3.9% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
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.
Timeline
ID reserved
By apache
- 1 day later
· 1 day later
Published
- 3 years later
· 3 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| NVDNVD · Modified | 3.1 | High7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
- EPSS (exploitation in 30 days)
- 11.8% · top 3.9% of all CVEs (12 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.5.
Affected products
Apache Software Foundation · Apache Tomcat
- affected Apache Tomcat 10 10.0.0-M10 to 10.0.11
- affected Apache Tomcat 10 10.1.0-M1 to 10.1.0-M5
- affected Apache Tomcat 9 9.0.40 to 9.0.53
- affected Apache Tomcat 8 8.5.60 to 8.5.71
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- Mavenorg.apache.tomcat:tomcatGHSA-wph7-x527-w3h5 (opens in a new tab)
References
References9
- https://lists.apache.org/thread.html/r83a35be60f06aca2065f188ee542b9099695d57ced2e70e0885f905c%40%3Cannounce.tomcat.apache.org%3E (opens in a new tab)x_refsource_MISCx_transferred
- [myfaces-commits] 20211021 [myfaces-tobago] branch tobago-5.x updated: build: workaround for CVE-2021-42340 (opens in a new tab)mailing-listx_refsource_MLISTx_transferred
- DSA-5009 (opens in a new tab)vendor-advisoryx_refsource_DEBIANx_transferred
- https://www.oracle.com/security-alerts/cpujan2022.html (opens in a new tab)x_refsource_MISCx_transferred
- https://security.netapp.com/advisory/ntap-20211104-0001/ (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://kc.mcafee.com/corporate/index?page=content&id=SB10379 (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://www.oracle.com/security-alerts/cpuapr2022.html (opens in a new tab)x_refsource_MISCx_transferred
- https://www.oracle.com/security-alerts/cpujul2022.html (opens in a new tab)x_refsource_MISCx_transferred
- GLSA-202208-34 (opens in a new tab)vendor-advisoryx_refsource_GENTOOx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-2266 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-wph7-x527-w3h5 (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-42340)Record last updated .