CVE-2023-42795: Apache Tomcat Apache Tomcat Incomplete Cleanup Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-g8pj-r55q-5c2v
CVSS 5.3
CWE-459
Published
Advisory Summary

CVE-2023-42795 is a MODERATE (CVSS 5.3) apache tomcat incomplete cleanup vulnerability vulnerability (CWE-459: Incomplete Cleanup) affecting Apache Tomcat libraries in the Maven ecosystem. The issue involves apache tomcat incomplete cleanup vulnerability. Remediation is available by upgrading affected packages to version 11.0.0-M12, 10.1.14, 9.0.81, 8.5.94.

CVE-2023-42795 at a Glance

CVE Identifier CVE-2023-42795
GHSA Identifier GHSA-g8pj-r55q-5c2v
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-459: Incomplete Cleanup
Affected Product Apache Tomcat
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2023-42795

To remediate this vulnerability, upgrade all affected Apache Tomcat dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.tomcat:tomcat-util fixed: 11.0.0-M12
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-util</artifactId>
    <version>11.0.0-M12</version>
</dependency>
org.apache.tomcat:tomcat fixed: 11.0.0-M12
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>11.0.0-M12</version>
</dependency>
org.apache.tomcat:tomcat fixed: 10.1.14
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>10.1.14</version>
</dependency>
org.apache.tomcat:tomcat fixed: 9.0.81
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>9.0.81</version>
</dependency>
org.apache.tomcat:tomcat fixed: 8.5.94
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>8.5.94</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 10.1.14
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>10.1.14</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 9.0.81
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>9.0.81</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 8.5.94
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>8.5.94</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 11.0.0-M12
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>11.0.0-M12</version>
</dependency>
org.apache.tomcat:tomcat-catalina fixed: 11.0.0-M12
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-catalina</artifactId>
    <version>11.0.0-M12</version>
</dependency>
org.apache.tomcat:tomcat-catalina fixed: 10.1.14
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-catalina</artifactId>
    <version>10.1.14</version>
</dependency>
org.apache.tomcat:tomcat-catalina fixed: 9.0.81
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-catalina</artifactId>
    <version>9.0.81</version>
</dependency>
org.apache.tomcat:tomcat-catalina fixed: 8.5.94
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-catalina</artifactId>
    <version>8.5.94</version>
</dependency>
org.apache.tomcat:tomcat-util fixed: 10.1.14
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-util</artifactId>
    <version>10.1.14</version>
</dependency>
org.apache.tomcat:tomcat-util fixed: 9.0.81
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-util</artifactId>
    <version>9.0.81</version>
</dependency>
org.apache.tomcat:tomcat-util fixed: 8.5.94
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-util</artifactId>
    <version>8.5.94</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.tomcat

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-42795, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.tomcat

Analyze the terminal output to locate any version of Apache Tomcat in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.0.0-M12), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.tomcat command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-459: Incomplete Cleanup, where the product does not properly "clean up" and remove temporary or supporting resources after they have been used. In Apache Tomcat, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Incomplete Cleanup vulnerability in Apache Tomcat. When recycling various internal objects in Apache Tomcat from 11.0.0-M1 through 11.0.0-M11, from 10.1.0-M1 through 10.1.13, from 9.0.0-M1 through 9.0.80 and from 8.5.0 through 8.5.93, an error could cause Tomcat to skip some parts of the recycling process leading to information leaking from the current request/response to the next. Older, EOL versions may also be affected. Users are recommended to upgrade to version 11.0.0-M12 onwards, 10.1.14 onwards, 9.0.81 onwards or 8.5.94 onwards, which fixes the issue.

CVE-2023-42795 Affected Apache Tomcat Versions

16 component(s)
Fixed Versions:
11.0.0-M1210.1.149.0.818.5.94
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.tomcat:tomcat-util
Maven
≥ 11.0.0-M1
< 11.0.0-M12
11.0.0-M12
org.apache.tomcat:tomcat
Maven
≥ 11.0.0-M1
< 11.0.0-M12
11.0.0-M12
org.apache.tomcat:tomcat
Maven
≥ 10.1.0-M1
< 10.1.14
10.1.14
org.apache.tomcat:tomcat
Maven
≥ 9.0.0-M1
< 9.0.81
9.0.81
org.apache.tomcat:tomcat
Maven
≥ 8.5.0
< 8.5.94
8.5.94
org.apache.tomcat.embed:tomcat-embed-core
Maven
≥ 10.1.0-M1
< 10.1.14
10.1.14
org.apache.tomcat.embed:tomcat-embed-core
Maven
≥ 9.0.0-M1
< 9.0.81
9.0.81
org.apache.tomcat.embed:tomcat-embed-core
Maven
≥ 8.5.0
< 8.5.94
8.5.94
org.apache.tomcat.embed:tomcat-embed-core
Maven
≥ 11.0.0-M1
< 11.0.0-M12
11.0.0-M12
org.apache.tomcat:tomcat-catalina
Maven
≥ 11.0.0-M1
< 11.0.0-M12
11.0.0-M12
org.apache.tomcat:tomcat-catalina
Maven
≥ 10.1.0-M1
< 10.1.14
10.1.14
org.apache.tomcat:tomcat-catalina
Maven
≥ 9.0.0-M1
< 9.0.81
9.0.81
org.apache.tomcat:tomcat-catalina
Maven
≥ 8.5.0
< 8.5.94
8.5.94
org.apache.tomcat:tomcat-util
Maven
≥ 10.1.0-M1
< 10.1.14
10.1.14
org.apache.tomcat:tomcat-util
Maven
≥ 9.0.0-M1
< 9.0.81
9.0.81
org.apache.tomcat:tomcat-util
Maven
≥ 8.5.0
< 8.5.94
8.5.94

References

Frequently Asked Questions

What is CVE-2023-42795?
CVE-2023-42795 is a security vulnerability in Apache Tomcat involving Apache Tomcat Incomplete Cleanup vulnerability under CWE-459: Incomplete Cleanup.
Which Apache Tomcat versions are affected?
Affected versions include releases prior to 11.0.0-M12, 10.1.14, 9.0.81, 8.5.94 across affected packages: org.apache.tomcat:tomcat-util, org.apache.tomcat:tomcat, org.apache.tomcat.embed:tomcat-embed-core, org.apache.tomcat:tomcat-catalina.
What version fixes CVE-2023-42795?
Upgrading to 11.0.0-M12, 10.1.14, 9.0.81, 8.5.94 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tomcat-util affected?
Yes, org.apache.tomcat:tomcat-util is affected in releases prior to 11.0.0-M12, 10.1.14, 9.0.81, 8.5.94. Upgrade your dependency to 11.0.0-M12, 10.1.14, 9.0.81, 8.5.94 or later.
Is tomcat affected?
Yes, org.apache.tomcat:tomcat is affected in releases prior to 11.0.0-M12, 10.1.14, 9.0.81, 8.5.94. Upgrade your dependency to 11.0.0-M12, 10.1.14, 9.0.81, 8.5.94 or later.
What is the CVSS score of CVE-2023-42795?
CVE-2023-42795 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2023-42795?
CVE-2023-42795 is classified under CWE-459: Incomplete Cleanup (The product does not properly "clean up" and remove temporary or supporting resources after they have been used.).
How can I check Maven dependencies for CVE-2023-42795?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.tomcat'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g8pj-r55q-5c2v",
  "modified" : "2026-06-12T19:50:46Z",
  "published" : "2023-10-10T18:31:35Z",
  "aliases" : [ "CVE-2023-42795" ],
  "summary" : "Apache Tomcat Incomplete Cleanup vulnerability",
  "details" : "Incomplete Cleanup vulnerability in Apache Tomcat.\n\nWhen recycling various internal objects in Apache Tomcat from 11.0.0-M1 through 11.0.0-M11, from 10.1.0-M1 through 10.1.13, from 9.0.0-M1 through 9.0.80 and from 8.5.0 through 8.5.93, an error could cause Tomcat to skip some parts of the recycling process leading to information leaking from the current request/response to the next.  Older, EOL versions may also be affected.\n\nUsers are recommended to upgrade to version 11.0.0-M12 onwards, 10.1.14 onwards, 9.0.81 onwards or 8.5.94 onwards, which fixes the issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0-M1"
      }, {
        "fixed" : "11.0.0-M12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.0-M1"
      }, {
        "fixed" : "10.1.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0-M1"
      }, {
        "fixed" : "9.0.81"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.5.0"
      }, {
        "fixed" : "8.5.94"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.0-M1"
      }, {
        "fixed" : "10.1.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0-M1"
      }, {
        "fixed" : "9.0.81"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.5.0"
      }, {
        "fixed" : "8.5.94"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0-M1"
      }, {
        "fixed" : "11.0.0-M12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-catalina"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0-M1"
      }, {
        "fixed" : "11.0.0-M12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-catalina"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.0-M1"
      }, {
        "fixed" : "10.1.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-catalina"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0-M1"
      }, {
        "fixed" : "9.0.81"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-catalina"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.5.0"
      }, {
        "fixed" : "8.5.94"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-util"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0-M1"
      }, {
        "fixed" : "11.0.0-M12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-util"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.0-M1"
      }, {
        "fixed" : "10.1.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-util"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0-M1"
      }, {
        "fixed" : "9.0.81"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-util"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.5.0"
      }, {
        "fixed" : "8.5.94"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-42795"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/30f8063d7a9b4c43ae4722f5e382a76af1d7a6bf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/44d05d75d696ca10ce251e4e370511e38f20ae75"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/9375d67106f8df9eb9d7b360b2bef052fe67d3d4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/d6db22e411307c97ddf78315c15d5889356eca38"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/tomcat"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/065jfyo583490r9j2v73nhpyxdob56lw"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/10/msg00020.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20231103-0007"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2023/dsa-5521"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2023/dsa-5522"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2023/10/10/9"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-459" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-10-10T22:30:05Z",
    "nvd_published_at" : "2023-10-10T18:15:18Z"
  }
}