CVE-2021-42340 in the critical feed json
DoS via memory leak with WebSocket connections
published 2021-10-14 5 y ago modified 2026-09-08 2 mo ago also BIT-tomcat-2021-42340 , EUVD-2021-2266 , GHSA-wph7-x527-w3h5
- cvss
- 7.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 11.8%
- EPSS 11.8% chance of exploitation in 30 days, percentile 96%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- maven org.apache.tomcat:tomcat 8.5.72, 9.0.54, 10.0.12, 10.1.0-M6
- bitnami tomcat 8.5.72, 9.0.54, 10.0.12
- apache tomcat 8.5.72, 9.0.54, 10.0.12
- oracle big_data_spatial_and_graph 23.1
- tomcat9 Debian 14, Debian 13, Debian 12 9.0.54-1
debian advisories DEBIAN-CVE-2021-42340
- jws5-tomcat jboss enterprise web server 5.6 9.0.50-3.redhat_00004.1.el7jws
- jws5-tomcat jboss enterprise web server 5.6 9.0.50-3.redhat_00004.1.el8jws
- jws5-tomcat-lib jboss enterprise web server 5.6 9.0.50-3.redhat_00004.1.el7jws
- jws5-tomcat-lib jboss enterprise web server 5.6 9.0.50-3.redhat_00004.1.el8jws
- jws5-tomcat-vault jboss enterprise web server 5.6 1.1.8-4.Final_redhat_00004.1.el7jws
- jws5-tomcat-vault jboss enterprise web server 5.6 1.1.8-4.Final_redhat_00004.1.el8jws
- jws5-tomcat-native jboss enterprise web server 5.6 1.2.30-3.redhat_3.el7jws
- jws5-tomcat-native jboss enterprise web server 5.6 1.2.30-3.redhat_3.el8jws
red hat advisories RHSA-2021:4861RHBA-2022:8077
- github.com/apache/tomcat@31d6242 commit
- github.com/apache/tomcat@80f1438 commit
- github.com/apache/tomcat@d27535b commit
- github.com/apache/tomcat@d5a6660 commit
- oracle.com/security-alerts/cpujan2022.html advisory
- oracle.com/security-alerts/cpuapr2022.html advisory
- oracle.com/security-alerts/cpujul2022.html advisory
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-42340 updated cvss 7.5
tomcat: OutOfMemoryError caused by HTTP upgrade connection leak could lead to DoS
-
Red Hat JBoss Fuse 6 tomcat Red Hat OpenStack Platform 10 (Newton) opendaylight Red Hat OpenStack Platform 13 (Queens) opendaylightaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux AppStream (v. 9) pki-servlet-engine 9.0.50-1.el9, pki-servlet-4.0-api 9.0.50-1.el9fixed: vendor fix RHBA-2022:8077
-
Red Hat Fuse 7.11fixed: vendor fix RHSA-2022:5532
-
Red Hat JBoss Web Server 5fixed: vendor fix RHSA-2021:4863
-
Red Hat JBoss Web Server 5.6 for RHEL 7 Server jws5-tomcat 9.0.50-3.redhat_00004.1.el7jws, jws5-tomcat-native 1.2.30-3.redhat_3.el7jws, jws5-tomcat-lib 9.0.50-3.redhat_00004.1.el7jws, jws5-tomcat-javadoc 9.0.50-3.redhat_00004.1.el7jws, jws5-tomcat-selinux 9.0.50-3.redhat_00004.1.el7jws, jws5-tomcat-webapps 9.0.50-3.redhat_00004.1.el7jws, +9 more Red Hat JBoss Web Server 5.6 for RHEL 8 jws5-tomcat 9.0.50-3.redhat_00004.1.el8jws, jws5-tomcat-native 1.2.30-3.redhat_3.el8jws, jws5-tomcat-lib 9.0.50-3.redhat_00004.1.el8jws, jws5-tomcat-javadoc 9.0.50-3.redhat_00004.1.el8jws, jws5-tomcat-selinux 9.0.50-3.redhat_00004.1.el8jws, jws5-tomcat-webapps 9.0.50-3.redhat_00004.1.el8jws, +7 morefixed: vendor fix RHSA-2021:4861
-
Red Hat Support for Spring Boot 2.5.10fixed: vendor fix RHSA-2022:1179
-
Red Hat Decision Manager 7 tomcat Red Hat Enterprise Linux 6 tomcat6, tomcat6-lib, tomcat6-log4j, tomcat6-javadoc, tomcat6-webapps, tomcat6-el-2.1-api, +4 more Red Hat Enterprise Linux 7 tomcat, tomcat-lib, tomcat-jsvc, tomcat-javadoc, tomcat-webapps, tomcat-el-2.2-api, +4 more Red Hat Enterprise Linux 8 pki-servlet-engine, pki-servlet-4.0-api Red Hat JBoss Data Grid 6 jbossweb jbossweb Red Hat JBoss Data Virtualization 6 jbossweb jbosswebnot affected: vulnerable code not present
+3 more productsfewer
Red Hat JBoss Enterprise Application Platform 6 jbossweb jbossweb Red Hat JBoss Web Server 3 tomcat Red Hat Process Automation 7 tomcat
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
11.80% chance of exploitation in the next 30 days, higher than 96% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
| OSV | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| maven | org.apache.tomcat:tomcat | >=10.1.0-M1, <10.1.0-M6 >=10.0.0-M1, <10.0.12 >=9.0.40, <9.0.54 >=8.5.60, <8.5.72 |
10.1.0-M6 10.0.12 9.0.54 8.5.72 |
| bitnami | tomcat | >=8.5.60, <8.5.72 >=9.0.40, <9.0.54 >=10.0.1, <10.0.12 |
8.5.72 9.0.54 10.0.12 |
Affected products
- Apache Software Foundation Apache Tomcat
Classification
- Weakness
-
- CWE-772 Missing Release of Resource after Effective Lifetime
References
-
oracle.com
/security-alerts/cpujan2022.html
web, patch, third-party-advisory, advisory
-
oracle.com
/security-alerts/cpuapr2022.html
web, patch, third-party-advisory, advisory
-
oracle.com
/security-alerts/cpujul2022.html
web, patch, third-party-advisory, advisory
-
github.com
/apache/tomcat/commit/31d62426645824bdfe076a0c0eafa904d90b4fb9
web
-
github.com
/apache/tomcat/commit/80f1438ec45e77a07b96419808971838d259eb47
web
-
github.com
/apache/tomcat/commit/d27535bdee95d252418201eb21e9d29476aa6b6a
web
-
github.com
/apache/tomcat/commit/d5a6660cba7f51589468937bf3bbad4db7810371
web
-
debian.org
/security/2021/dsa-5009
vendor-advisory, web, third-party-advisory, advisory
-
security.gentoo.org
/glsa/202208-34
vendor-advisory, web, third-party-advisory, advisory
-
lists.apache.org
/thread.html/r83a35be60f06aca2065f188ee542b9099695d57ced2e70e0885f905c%40%3Cannounce.tomcat.apache.org%3E
web, mailing-list, vendor-advisory, advisory
-
lists.apache.org
/thread.html/r8097a2d1550aa78e585fc77e602b9046e6d4099d8d132497c5387784%40%3Ccommits.myfaces.apache.org%3E
mailing-list, web
-
security.netapp.com
/advisory/ntap-20211104-0001/
third-party-advisory, advisory
-
kc.mcafee.com
/corporate/index?page=content&id=SB10379
web, third-party-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-42340
advisory, web
-
tomcat.apache.org
/security-9.html
web
-
tomcat.apache.org
/security-8.html
web
-
tomcat.apache.org
/security-10.html
web
-
security.netapp.com
/advisory/ntap-20211104-0001
web
-
lists.apache.org
/thread.html/r8097a2d1550aa78e585fc77e602b9046e6d4099d8d132497c5387784@%3Ccommits.myfaces.apache.org%3E
web
-
github.com
/apache/tomcat
package
Sources
- CVE List CVE-2021-42340
- GitHub Advisory GHSA-wph7-x527-w3h5
- NVD CVE-2021-42340
- OSV BIT-tomcat-2021-42340
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.