Miggo Logo

CVE-2024-50379:
Apache Tomcat Time-of-check Time-of-use (TOCTOU) Race Condition vulnerability

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.99483%
Published
12/17/2024
Updated
1/3/2025
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.apache.tomcat:tomcat-catalinamaven>= 11.0.0-M1, < 11.0.211.0.2
org.apache.tomcat:tomcat-catalinamaven>= 10.1.0-M1, < 10.1.3410.1.34
org.apache.tomcat:tomcat-catalinamaven>= 9.0.0.M1, < 9.0.989.0.98
org.apache.tomcat.embed:tomcat-embed-coremaven>= 11.0.0-M1, < 11.0.211.0.2
org.apache.tomcat.embed:tomcat-embed-coremaven>= 10.1.0-M1, < 10.1.3410.1.34
org.apache.tomcat.embed:tomcat-embed-coremaven>= 9.0.0.M1, < 9.0.989.0.98

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper synchronization in DirResourceSet's locking mechanism. The commit diff shows missing resourceLocksByPath.put() calls when creating new ResourceLocks, allowing concurrent threads to bypass file state checks. This enabled race conditions where an attacker could replace a checked file (e.g., .jsp) with malicious content before compilation. The case-insensitive filesystem aspect exacerbates this by allowing case-variant file replacement. The patch adds the missing put() operations to ensure lock visibility across threads, directly addressing the TOCTOU gap.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

Tim*-o*-****k Tim*-o*-us* (TO*TOU) R*** *on*ition vuln*r**ility *urin* JSP *ompil*tion in *p**** Tom**t p*rmits *n R** on **s* ins*nsitiv* *il* syst*ms w**n t** ****ult s*rvl*t is *n**l** *or writ* (non-****ult *on*i*ur*tion). T*is issu* *****ts *p*

Reasoning

T** vuln*r**ility st*ms *rom improp*r syn**roniz*tion in `*irR*sour**S*t`'s lo*kin* m****nism. T** *ommit *i** s*ows missin* `r*sour**Lo*ks*yP*t*.put()` **lls w**n *r**tin* n*w `R*sour**Lo*ks`, *llowin* *on*urr*nt t*r***s to *yp*ss *il* st*t* ****ks.