Skip to content
Fencer Vulns
high 7.5

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

  • tomcat10 Arch Linux 10.0.12-1
  • tomcat9 Arch Linux 9.0.54-1

arch linux advisories AVG-2469AVG-2470

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) opendaylight
    affected: 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.el9
    fixed: vendor fix RHBA-2022:8077
  • Red Hat Fuse 7.11
    fixed: vendor fix RHSA-2022:5532
  • Red Hat JBoss Web Server 5
    fixed: 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 more
    fixed: vendor fix RHSA-2021:4861
  • Red Hat Support for Spring Boot 2.5.10
    fixed: 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 jbossweb
    +3 more products
    Red Hat JBoss Enterprise Application Platform 6 jbossweb jbossweb Red Hat JBoss Web Server 3 tomcat Red Hat Process Automation 7 tomcat
    not affected: vulnerable code not present

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

Sources

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.