CVEfocus › CVE database › CVE-2021-42340

CVE-2021-42340DoS via memory leak with WebSocket connections

CVSS 7.5 HighEPSS 10.8% (higher than 97% of CVEs)Published 2021-10-14Updated 2024-08-04Assigner: apache

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.

CWE-772

What to do

Likely to be exploited: EPSS gives a 11% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.

Fixed builds are available from Debian, Maven, Red Hat: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

6Fixed
1Fix pending
22Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 16.04tomcat8Fix pending
Debian 14tomcat9Fixed9.0.54-1DEBIAN-CVE-2021-42340
Debian 13tomcat9Fixed9.0.54-1DEBIAN-CVE-2021-42340
Debian 12tomcat9Fixed9.0.54-1DEBIAN-CVE-2021-42340
Red Hat Enterprise Linux 9pki-servlet-4.0-apiFixed1:9.0.50-1.el9RHBA-2022:8077
Red Hat Enterprise Linux 9pki-servlet-engineFixed1:9.0.50-1.el9RHBA-2022:8077
Red Hat Enterprise Linux 8pki-servlet-4.0-apiNot affected
Red Hat Enterprise Linux 8pki-servlet-engineNot affected
Red Hat Enterprise Linux 7tomcatNot affected
Red Hat Enterprise Linux 7tomcat-admin-webappsNot affected
Red Hat Enterprise Linux 7tomcat-docs-webappNot affected
Red Hat Enterprise Linux 7tomcat-el-2.2-apiNot affected
Red Hat Enterprise Linux 7tomcat-javadocNot affected
Red Hat Enterprise Linux 7tomcat-jsp-2.2-apiNot affected
Red Hat Enterprise Linux 7tomcat-jsvcNot affected
Red Hat Enterprise Linux 7tomcat-libNot affected
Red Hat Enterprise Linux 7tomcat-servlet-3.0-apiNot affected
Red Hat Enterprise Linux 7tomcat-webappsNot affected
Red Hat Enterprise Linux 6tomcat6Not affected
Red Hat Enterprise Linux 6tomcat6-admin-webappsNot affected
Red Hat Enterprise Linux 6tomcat6-docs-webappNot affected
Red Hat Enterprise Linux 6tomcat6-el-2.1-apiNot affected
Red Hat Enterprise Linux 6tomcat6-javadocNot affected
Red Hat Enterprise Linux 6tomcat6-jsp-2.1-apiNot affected
Red Hat Enterprise Linux 6tomcat6-libNot affected
Red Hat Enterprise Linux 6tomcat6-log4jNot affected
Red Hat Enterprise Linux 6tomcat6-servlet-2.5-apiNot affected
Red Hat Enterprise Linux 6tomcat6-webappsNot affected
Maven libraryorg.apache.tomcat:tomcatFixed10.0.12GHSA-wph7-x527-w3h5

What the vendor says

As published in the CVE record by apache, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.