Miggo Logo

CVE-2024-52291: Local File System Validation Bypass Leading to File Overwrite, Sensitive File Access, and Potential Code Execution

8.5

CVSS Score
3.1

Basic Information

EPSS Score
0.40847%
Published
11/13/2024
Updated
11/13/2024
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
craftcms/cmscomposer>= 5.0.0-RC1, <= 5.4.5.15.4.6
craftcms/cmscomposer>= 4.0.0-RC1, <= 4.12.4.14.12.5

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from FileHelper::normalizePath's insufficient handling of protocol wrappers. The function uses StringHelper::removeLeft() to strip 'file://' once, but fails to account for multiple occurrences. This allows attackers to bypass path validation by prefixing paths with 'file://file://', leaving a residual 'file://' after sanitization. The advisory explicitly identifies this function and line 57 as the root cause, and the PoC demonstrates how the bypass works in practice. No other functions are mentioned as contributing to this specific validation bypass mechanism.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry * vuln*r**ility in *r**t*MS *llows *n *tt**k*r to *yp*ss lo**l *il* syst*m v*li**tion *y utilizin* * *ou*l* `*il*://` s***m* (*.*., `*il*://*il*:////`). T*is *n**l*s t** *tt**k*r to sp**i*y s*nsitiv* *ol**rs *s t** *il* syst*m, l***in* to

Reasoning

T** vuln*r**ility st*ms *rom `*il***lp*r::norm*liz*P*t*`'s insu**i*i*nt **n*lin* o* proto*ol wr*pp*rs. T** *un*tion us*s `Strin***lp*r::r*mov*L**t()` to strip '*il*://' on**, *ut **ils to ***ount *or multipl* o**urr*n**s. T*is *llows *tt**k*rs to *yp