CVE-2021-25329:
Potential remote code execution in Apache Tomcat
7
CVSS ScoreBasic Information
CVE ID
GHSA ID
EPSS Score
-
CWE
Published
3/19/2021
Updated
2/3/2023
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched 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.107 | 7.0.108 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from using string-based path comparisons (getCanonicalPath().startsWith()) rather than proper Path object comparisons. This could allow bypassing directory containment checks via symlinks, case variations, or filesystem-specific path representations. The commit 6d66e99 explicitly replaces these vulnerable string comparisons with java.nio.file.Path comparisons in multiple files, indicating these were the vulnerable functions. The files shown in the diff (DefaultServlet.java, FileStore.java, HostConfig.java etc.) all contained this pattern and were patched by switching to Path-based checks.