CVE-2021-25329: Apache Tomcat Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-jgwr-3qm3-26f3
CVSS 7.0
CWE-502
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2021-25329
GHSA Identifier GHSA-jgwr-3qm3-26f3
Severity HIGH
CVSS v3.1 Base Score 7.0
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Apache Tomcat
Package Ecosystem Maven
Published Date
Last Updated

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).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

org.apache.tomcat.embed:tomcat-embed-core fixed: 10.0.2
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>10.0.2</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 9.0.41
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>9.0.41</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 8.5.61
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>8.5.61</version>
</dependency>
org.apache.tomcat.embed:tomcat-embed-core fixed: 7.0.108
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>7.0.108</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-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

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.

CVE-2021-25329 Affected Apache Tomcat Versions

4 component(s)
Fixed Versions:
10.0.29.0.418.5.617.0.108
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

NVD — CVE-2021-25329 NVD
https://nvd.nist.gov/vuln/detail/CVE-2021-25329
Security Fix Commit FIX COMMIT
https://github.com/apache/tomcat/commit/6d66e99ef85da93e4d2c2a536ca51aa3418bfaf4
Apache Tomcat Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2021.html
Apache Tomcat Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2022.html
Apache Tomcat Security Information SECURITY
https://www.oracle.com//security-alerts/cpujul2021.html
Apache Tomcat Security Information SECURITY
https://www.debian.org/security/2021/dsa-4891
Apache Tomcat Security Information SECURITY
https://security.netapp.com/advisory/ntap-20210409-0002
Apache Tomcat Security Information SECURITY
https://security.gentoo.org/glsa/202208-34
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2021/03/msg00018.html
lists.apache.org/thread.html/rfe62fb... WEB
https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf@%3Cusers.tomcat.apache.org%3E
lists.apache.org/thread.html/rfe62fb... WEB
https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf@%3Cdev.tomcat.apache.org%3E
lists.apache.org/thread.html/rfe62fb... WEB
https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf@%3Cannounce.tomcat.apache.org%3E
lists.apache.org/thread.html/rfe62fb... WEB
https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf@%3Cannounce.apache.org%3E
lists.apache.org/thread.html/rfe62fb... WEB
https://lists.apache.org/thread.html/rfe62fbf9d4c314f166fe8c668e50e5d9dd882a99447f26f0367474bf%40%3Cannounce.tomcat.apache.org%3E
lists.apache.org/thread.html/rf6d5d5... WEB
https://lists.apache.org/thread.html/rf6d5d57b114678d8898005faef31e9fd6d7c981fcc4ccfc3bc272fc9@%3Cdev.tomcat.apache.org%3E
lists.apache.org/thread.html/rb51ccd... WEB
https://lists.apache.org/thread.html/rb51ccd58b2152fc75125b2406fc93e04ca9d34e737263faa6ff0f41f@%3Cusers.tomcat.apache.org%3E
lists.apache.org/thread.html/r8a2ac0... WEB
https://lists.apache.org/thread.html/r8a2ac0e476dbfc1e6440b09dcc782d444ad635d6da26f0284725a5dc@%3Cusers.tomcat.apache.org%3E
lists.apache.org/thread.html/r732b2c... WEB
https://lists.apache.org/thread.html/r732b2ca289dc02df2de820e8775559abd6c207f159e39f559547a085@%3Cusers.tomcat.apache.org%3E
lists.apache.org/thread.html/r11ce01... WEB
https://lists.apache.org/thread.html/r11ce01e8a4c7269b88f88212f21830edf73558997ac7744f37769b77@%3Cusers.tomcat.apache.org%3E
Apache Tomcat Source Repository REPOSITORY
https://github.com/apache/tomcat
Apache Tomcat Security Information SECURITY
http://www.openwall.com/lists/oss-security/2021/03/01/2

Frequently Asked Questions

What is CVE-2021-25329?
CVE-2021-25329 is a security vulnerability in Apache Tomcat involving Potential remote code execution in Apache Tomcat under CWE-502: Deserialization of Untrusted Data.
Which Apache Tomcat versions are affected?
Affected versions include releases prior to 10.0.2, 9.0.41, 8.5.61, 7.0.108 across affected packages: org.apache.tomcat.embed:tomcat-embed-core.
What version fixes CVE-2021-25329?
Upgrading to 10.0.2, 9.0.41, 8.5.61, 7.0.108 (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 10.0.2, 9.0.41, 8.5.61, 7.0.108. Upgrade your dependency to 10.0.2, 9.0.41, 8.5.61, 7.0.108 or later.
What is the CVSS score of CVE-2021-25329?
CVE-2021-25329 has a CVSS v3.1 base score of 7.0 (HIGH) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-25329?
CVE-2021-25329 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Maven dependencies for CVE-2021-25329?
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-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"
  }
}