Breaking News: Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret
Read the Report
Learn How MCP Is Bypassing a Decade of Cloud Security Best Practices
Read the Report
Are you exposed? Connect a repo in minutes.
Scan your repos free

CVE-2021-42340

tomcat: OutOfMemoryError caused by HTTP upgrade connection leak could lead to DoS

Overview

Published
14 Oct 2021
Modified
17 Jun 2026
High CVE
2 Registry packages
21 OS packages
4 Linux distributions
Yes Fix available

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.

Source: OX vulnerability database

Severity

7.5 · HIGH

CVSS 3.1 base score, scored by NVD.

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Weakness: CWE-772

Affected packages · 2

Packages affected by CVE-2021-42340
EcosystemPackageVulnerableFixed in
Bitnami tomcat >=8.5.60, <8.5.72>=9.0.40, <9.0.54>=10.0.1, <10.0.12 8.5.729.0.5410.0.12
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-M610.0.129.0.548.5.72

Open a package to see all its vulnerabilities.

Operating systems · 15 fixes

Photon OS 1 release · 1 package

fixed 1
apache-tomcat
Photon OS fixes for CVE-2021-42340
ReleasePackageFixed in
4.0 apache-tomcat +1 8.5.72-1.ph4

Red Hat 3 releases · 5 packages

eol 1 fixed 7 affected 1
opendaylight jws5-tomcat-vault jws5-tomcat-native jws5-tomcat pki-servlet-4-0-api
Red Hat fixes for CVE-2021-42340
ReleasePackageFixed inAdvisory
7 opendaylight eol —
7 jws5-tomcat-vault +1 0:1.1.8-4.Final_redhat_00004.1.el7jws RHSA-2021:4861
7 jws5-tomcat-native 0:1.2.30-3.redhat_3.el7jws RHSA-2021:4861
7 jws5-tomcat +11 0:9.0.50-3.redhat_00004.1.el7jws RHSA-2021:4861
8 jws5-tomcat-vault +1 0:1.1.8-4.Final_redhat_00004.1.el8jws RHSA-2021:4861
8 jws5-tomcat-native 0:1.2.30-3.redhat_3.el8jws RHSA-2021:4861

3 more rows

debian 4 releases · 1 package

fixed 4
tomcat9
debian fixes for CVE-2021-42340
ReleasePackageFixed in
11 tomcat9 9.0.43-2~deb11u3
12 tomcat9 9.0.54-1
13 tomcat9 9.0.54-1
14 tomcat9 9.0.54-1

echo 1 release · 1 package

fixed 1
tomcat9
echo fixes for CVE-2021-42340
ReleasePackageFixed in
tomcat9 9.0.54-1

References

Show all 26 references

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.