CVE-2022-42252: Apache Tomcat Apache Tomcat May Reject Request Vulnerability

HIGH
Advisory Identifier: GHSA-p22x-g9px-3945
CVSS 7.5
CWE-444 CWE-20
Published
Advisory Summary

CVE-2022-42252 is a HIGH (CVSS 7.5) apache tomcat may reject request vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting Apache Tomcat libraries in the Maven ecosystem. The issue involves apache tomcat may reject request containing invalid content-length header. Remediation is available by upgrading affected packages to version 8.5.83, 9.0.68, 10.0.27, 10.1.1.

CVE-2022-42252 at a Glance

CVE Identifier CVE-2022-42252
GHSA Identifier GHSA-p22x-g9px-3945
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
Affected Product Apache Tomcat
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/I:H/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 None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2022-42252

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.embed:tomcat-embed-core fixed: 8.5.83
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>8.5.83</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 9.0.68
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>9.0.68</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 10.0.27
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>10.0.27</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 10.1.1
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>10.1.1</version>
</dependency>
org.apache.tomcat:tomcat-coyote fixed: 9.0.68
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-coyote</artifactId>
    <version>9.0.68</version>
</dependency>
org.apache.tomcat:tomcat-coyote fixed: 10.0.27
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-coyote</artifactId>
    <version>10.0.27</version>
</dependency>
org.apache.tomcat:tomcat-coyote fixed: 10.1.1
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-coyote</artifactId>
    <version>10.1.1</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.embed

How to Check if You Are Affected

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

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

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 8.5.83), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.tomcat.embed 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-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where the product acts as an intermediary http agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed http requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination. 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

If Apache Tomcat 8.5.0 to 8.5.82, 9.0.0-M1 to 9.0.67, 10.0.0-M1 to 10.0.26 or 10.1.0-M1 to 10.1.0 was configured to ignore invalid HTTP headers via setting rejectIllegalHeader to false (the default for 8.5.x only), Tomcat did not reject a request containing an invalid Content-Length header making a request smuggling attack possible if Tomcat was located behind a reverse proxy that also failed to reject the request with the invalid header.

CVE-2022-42252 Affected Apache Tomcat Versions

7 component(s)
Fixed Versions:
8.5.839.0.6810.0.2710.1.1
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.tomcat.embed:tomcat-embed-core
Maven
≥ 8.5.0
< 8.5.83
8.5.83
org.apache.tomcat.embed:tomcat-embed-core
Maven
≥ 9.0.0-M1
< 9.0.68
9.0.68
org.apache.tomcat.embed:tomcat-embed-core
Maven
≥ 10.0.0-M1
< 10.0.27
10.0.27
org.apache.tomcat.embed:tomcat-embed-core
Maven
≥ 10.1.0-M1
< 10.1.1
10.1.1
org.apache.tomcat:tomcat-coyote
Maven
≥ 9.0.0-M1
< 9.0.68
9.0.68
org.apache.tomcat:tomcat-coyote
Maven
≥ 10.0.0-M1
< 10.0.27
10.0.27
org.apache.tomcat:tomcat-coyote
Maven
≥ 10.1.0-M1
< 10.1.1
10.1.1

References

Frequently Asked Questions

What is CVE-2022-42252?
CVE-2022-42252 is a security vulnerability in Apache Tomcat involving Apache Tomcat may reject request containing invalid Content-Length header under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling').
Which Apache Tomcat versions are affected?
Affected versions include releases prior to 8.5.83, 9.0.68, 10.0.27, 10.1.1 across affected packages: org.apache.tomcat.embed:tomcat-embed-core, org.apache.tomcat:tomcat-coyote.
What version fixes CVE-2022-42252?
Upgrading to 8.5.83, 9.0.68, 10.0.27, 10.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tomcat-embed-core affected?
Yes, org.apache.tomcat.embed:tomcat-embed-core is affected in releases prior to 8.5.83, 9.0.68, 10.0.27, 10.1.1. Upgrade your dependency to 8.5.83, 9.0.68, 10.0.27, 10.1.1 or later.
Is tomcat-coyote affected?
Yes, org.apache.tomcat:tomcat-coyote is affected in releases prior to 9.0.68, 10.0.27, 10.1.1. Upgrade your dependency to 9.0.68, 10.0.27, 10.1.1 or later.
What is the CVSS score of CVE-2022-42252?
CVE-2022-42252 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2022-42252?
CVE-2022-42252 is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') (The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination.).
How can I check Maven dependencies for CVE-2022-42252?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.tomcat.embed'. 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-p22x-g9px-3945",
  "modified" : "2024-04-23T20:42:24Z",
  "published" : "2022-11-01T12:00:30Z",
  "aliases" : [ "CVE-2022-42252" ],
  "summary" : "Apache Tomcat may reject request containing invalid Content-Length header",
  "details" : "If Apache Tomcat 8.5.0 to 8.5.82, 9.0.0-M1 to 9.0.67, 10.0.0-M1 to 10.0.26 or 10.1.0-M1 to 10.1.0 was configured to ignore invalid HTTP headers via setting rejectIllegalHeader to false (the default for 8.5.x only), Tomcat did not reject a request containing an invalid Content-Length header making a request smuggling attack possible if Tomcat was located behind a reverse proxy that also failed to reject the request with the invalid header.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.5.0"
      }, {
        "fixed" : "8.5.83"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0-M1"
      }, {
        "fixed" : "9.0.68"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0-M1"
      }, {
        "fixed" : "10.0.27"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat.embed:tomcat-embed-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.0-M1"
      }, {
        "fixed" : "10.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-coyote"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0-M1"
      }, {
        "fixed" : "9.0.68"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-coyote"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0-M1"
      }, {
        "fixed" : "10.0.27"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.tomcat:tomcat-coyote"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.1.0-M1"
      }, {
        "fixed" : "10.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-42252"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/0d089a15047faf9cb3c82f80f4d28febd4798920"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/4c7f4fd09d2cc1692112ef70b8ee23a7a037ae77"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/a1c07906d8dcaf7957e5cc97f5cdbac7d18a205a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/tomcat/commit/c9fe754e5d17e262dfbd3eab2a03ca96ff372dc3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/tomcat"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/zzcxzvqfdqn515zfs3dxb7n8gty589sq"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202305-37"
  }, {
    "type" : "WEB",
    "url" : "https://tomcat.apache.org/security-10.html"
  }, {
    "type" : "WEB",
    "url" : "https://tomcat.apache.org/security-8.html"
  }, {
    "type" : "WEB",
    "url" : "https://tomcat.apache.org/security-9.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-444" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-01T18:37:42Z",
    "nvd_published_at" : "2022-11-01T09:15:00Z"
  }
}