Skip to content
OpenAdvisories
High · 7.5 CVE-2021-42340 BIT-tomcat-2021-42340EUVD-2021-2266GHSA-wph7-x527-w3h5

DoS via memory leak with WebSocket connections

Published Oct 14, 2021 · Updated Aug 4, 2024 · Assigned by apache

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.

Affected products

VendorProductAffectedFixed
Apache Software Foundation Apache Tomcat Apache Tomcat 10 10.0.0-M10 to 10.0.11, Apache Tomcat 10 10.1.0-M1 to 10.1.0-M5, Apache Tomcat 9 9.0.40 to 9.0.53, Apache Tomcat 8 8.5.60 to 8.5.71 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 tomcat9 9.0.54-1 —
Debian 13 tomcat9 9.0.54-1 —
Debian 12 tomcat9 9.0.54-1 —
Debian 11 tomcat9 9.0.43-2~deb11u3 DSA-5009-1
ReleasePackageFixed inAdvisory
RHEL 9 pki-servlet-engine +1 1:9.0.50-1.el9 RHBA-2022:8077
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Red Hat JBoss Web Server 5 jws5-tomcat +11 9.0.50-3.redhat_00004.1.el7jws RHSA-2021:4861
Red Hat JBoss Web Server 5 jws5-tomcat-native 1.2.30-3.redhat_3.el7jws RHSA-2021:4861
Red Hat JBoss Web Server 5 jws5-tomcat-vault +1 1.1.8-4.Final_redhat_00004.1.el7jws RHSA-2021:4861

Affected packages

EcosystemPackageAffectedFixedRecord
Maven org.apache.tomcat:tomcat >= 10.1.0-M1, < 10.1.0-M6 10.1.0-M6 GHSA-wph7-x527-w3h5
Maven org.apache.tomcat:tomcat >= 10.0.0-M1, < 10.0.12 10.0.12 GHSA-wph7-x527-w3h5
Maven org.apache.tomcat:tomcat >= 9.0.40, < 9.0.54 9.0.54 GHSA-wph7-x527-w3h5
Maven org.apache.tomcat:tomcat >= 8.5.60, < 8.5.72 8.5.72 GHSA-wph7-x527-w3h5

Advisories 8

References