Miggo Logo

CVE-2021-25329:
Potential remote code execution in Apache Tomcat

7

CVSS Score

Basic Information

EPSS Score
-
Published
3/19/2021
Updated
2/3/2023
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.apache.tomcat.embed:tomcat-embed-coremaven>= 10.0.0-M1, < 10.0.210.0.2
org.apache.tomcat.embed:tomcat-embed-coremaven>= 9.0.0, < 9.0.419.0.41
org.apache.tomcat.embed:tomcat-embed-coremaven>= 8.0.0, < 8.5.618.5.61
org.apache.tomcat.embed:tomcat-embed-coremaven>= 7.0.0, < 7.0.1077.0.108

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

T** *ix *or *V*-****-**** w*s in*ompl*t*. W**n usin* *p**** Tom**t **.*.*-M* to **.*.*, *.*.*.M* to *.*.**, *.*.* to *.*.** or *.*.*. to *.*.*** wit* * *on*i*ur*tion **** **s* t**t w*s *i**ly unlik*ly to ** us**, t** Tom**t inst*n** w*s still vuln*r*

Reasoning

T** vuln*r**ility st*mm** *rom usin* strin*-**s** p*t* *omp*risons (**t**noni**lP*t*().st*rtsWit*()) r*t**r t**n prop*r P*t* o*j**t *omp*risons. T*is *oul* *llow *yp*ssin* *ir**tory *ont*inm*nt ****ks vi* symlinks, **s* v*ri*tions, or *il*syst*m-sp**