CVE-2021-25329: Apache Tomcat Remote Code Execution Vulnerability
HIGHCVE-2021-25329 is a HIGH (CVSS 7.0) remote code execution vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Apache Tomcat libraries in the Maven ecosystem. The issue involves potential remote code execution in apache tomcat. Remediation is available by upgrading affected packages to version 10.0.2, 9.0.41, 8.5.61, 7.0.108.
CVE-2021-25329 at a Glance
Security Impact
CVSS: 7.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2021-25329
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>10.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.41</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>8.5.61</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>7.0.108</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-2021-25329, 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 10.0.2), 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. 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-2021-25329 Affected Apache Tomcat Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.tomcat.embed:tomcat-embed-core
|
Maven |
≥ 10.0.0-M1
< 10.0.2
|
10.0.2
|
|
org.apache.tomcat.embed:tomcat-embed-core
|
Maven |
≥ 9.0.0
< 9.0.41
|
9.0.41
|
|
org.apache.tomcat.embed:tomcat-embed-core
|
Maven |
≥ 8.0.0
< 8.5.61
|
8.5.61
|
|
org.apache.tomcat.embed:tomcat-embed-core
|
Maven |
≥ 7.0.0
< 7.0.108
|
7.0.108
|
References
Frequently Asked Questions
What is CVE-2021-25329?
Which Apache Tomcat versions are affected?
What version fixes CVE-2021-25329?
Is tomcat-embed-core affected?
What is the CVSS score of CVE-2021-25329?
What CWE is associated with CVE-2021-25329?
How can I check Maven dependencies for CVE-2021-25329?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jgwr-3qm3-26f3",
"modified" : "2022-08-22T19:40:41Z",
"published" : "2021-03-19T20:11:13Z",
"aliases" : [ "CVE-2021-25329" ],
"summary" : "Potential remote code execution in Apache Tomcat",
"details" : "The fix for CVE-2020-9484 was incomplete. When using Apache Tomcat 10.0.0-M1 to 10.0.0, 9.0.0.M1 to 9.0.41, 8.5.0 to 8.5.61 or 7.0.0. to 7.0.107 with a configuration edge case that was highly unlikely to be used, the Tomcat instance was still vulnerable to CVE-2020-9494. Note that both the previously published prerequisites for CVE-2020-9484 and the previously published mitigations for CVE-2020-9484 also apply to this issue.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "10.0.0-M1"
}, {
"fixed" : "10.0.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.0.0"
}, {
"fixed" : "9.0.41"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.5.61"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tomcat.embed:tomcat-embed-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.0.108"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "< 7.0.107"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-25329"
}, {
"type" : "WEB",
"url" : "https://github.com/apache/tomcat/commit/6d66e99ef85da93e4d2c2a536ca51aa3418bfaf4"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuoct2021.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujan2022.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com//security-alerts/cpujul2021.html"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2021/dsa-4891"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20210409-0002"
}, {
"type" : "WEB",
"url" : "https://security.gentoo.org/glsa/202208-34"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2021/03/msg00018.html"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf@%3Cusers.tomcat.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf@%3Cdev.tomcat.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf@%3Cannounce.tomcat.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf@%3Cannounce.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf%40%3Cannounce.tomcat.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/rf6d5d57b114678d8898005faef31e9fd6d7c981fcc4ccfc3bc272fc9@%3Cdev.tomcat.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/rb51ccd58b2152fc75125b2406fc93e04ca9d34e737263faa6ff0f41f@%3Cusers.tomcat.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r8a2ac0e476dbfc1e6440b09dcc782d444ad635d6da26f0284725a5dc@%3Cusers.tomcat.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r732b2ca289dc02df2de820e8775559abd6c207f159e39f559547a085@%3Cusers.tomcat.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r11ce01e8a4c7269b88f88212f21830edf73558997ac7744f37769b77@%3Cusers.tomcat.apache.org%3E"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apache/tomcat"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2021/03/01/2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-03-19T20:10:56Z",
"nvd_published_at" : "2021-03-01T12:15:00Z"
}
}