CVE-2022-45143: Apache Tomcat Apache Tomcat Improperly Escapes Input Vulnerability
HIGHCVE-2022-45143 is a HIGH (CVSS 7.5) apache tomcat improperly escapes input vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Apache Tomcat libraries in the Maven ecosystem. The issue involves apache tomcat improperly escapes input from jsonerrorreportvalve. Remediation is available by upgrading affected packages to version 8.5.84, 9.0.69, 10.1.2.
CVE-2022-45143 at a Glance
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).
How to Fix CVE-2022-45143
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.
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>8.5.84</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.69</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>10.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>10.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>8.5.84</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>9.0.69</version>
</dependency>
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-45143, 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.84), 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-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. 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
CVE-2022-45143 Affected Apache Tomcat Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.tomcat.embed:tomcat-embed-core
|
Maven |
≥ 8.5.83
< 8.5.84
All 1 versions
8.5.83
|
8.5.84
|
|
org.apache.tomcat.embed:tomcat-embed-core
|
Maven |
≥ 9.0.40
< 9.0.69
|
9.0.69
|
|
org.apache.tomcat.embed:tomcat-embed-core
|
Maven |
≥ 10.1.0
< 10.1.2
|
10.1.2
|
|
org.apache.tomcat:tomcat-catalina
|
Maven |
≥ 10.1.0
< 10.1.2
|
10.1.2
|
|
org.apache.tomcat:tomcat-util
|
Maven |
≥ 8.5.83
< 8.5.84
All 1 versions
8.5.83
|
8.5.84
|
|
org.apache.tomcat:tomcat-util
|
Maven |
≥ 9.0.40
< 9.0.69
|
9.0.69
|
References
Frequently Asked Questions
What is CVE-2022-45143?
Which Apache Tomcat versions are affected?
What version fixes CVE-2022-45143?
Is tomcat-embed-core affected?
Is tomcat-catalina affected?
What is the CVSS score of CVE-2022-45143?
What CWE is associated with CVE-2022-45143?
How can I check Maven dependencies for CVE-2022-45143?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rq2w-37h9-vg94",
"modified" : "2024-04-23T21:44:48Z",
"published" : "2023-01-03T21:30:21Z",
"aliases" : [ "CVE-2022-45143" ],
"summary" : "Apache Tomcat improperly escapes input from JsonErrorReportValve",
"details" : "The `JsonErrorReportValve` in Apache Tomcat 8.5.83, 9.0.40 to 9.0.68 and 10.1.0-M1 to 10.1.1 does not escape the `type`, `message` or `description` values. In some circumstances these are constructed from user provided data and it was therefore possible for users to supply values that invalidated or manipulated the JSON output.",
"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.83"
}, {
"fixed" : "8.5.84"
} ]
} ],
"versions" : [ "8.5.83" ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.0.40"
}, {
"fixed" : "9.0.69"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 9.0.68"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "10.1.0"
}, {
"fixed" : "10.1.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 10.1.1"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat:tomcat-catalina"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "10.1.0"
}, {
"fixed" : "10.1.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 10.1.1"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat:tomcat-util"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.5.83"
}, {
"fixed" : "8.5.84"
} ]
} ],
"versions" : [ "8.5.83" ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat:tomcat-util"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.0.40"
}, {
"fixed" : "9.0.69"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-45143"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/tomcat/commit/0cab3a56bd89f70e7481bb0d68395dc7e130dbbf"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/tomcat/commit/6a0ac6a438cbbb66b6e9c5223842f53bf0cb50aa"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/tomcat/commit/b336f4e58893ea35114f1e4a415657f723b1298e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/tomcat"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread/yqkd183xrw3wqvnpcg3osbcryq85fkzj"
}, {
"type" : "WEB",
"url" : "https://security.gentoo.org/glsa/202305-37"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116", "CWE-74" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-01-05T12:02:50Z",
"nvd_published_at" : "2023-01-03T19:15:00Z"
}
}