Miggo Logo

CVE-2023-29159: Starlette has Path Traversal vulnerability in StaticFiles

3.7

CVSS Score
3.1

Basic Information

EPSS Score
0.7904%
Published
5/17/2023
Updated
10/28/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
starlettepip>= 0.13.5, < 0.27.00.27.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the use of os.path.commonprefix() in the path validation logic. The Python documentation explicitly states this function does not account for path components, making it unsuitable for security checks. The commit diff shows replacement of commonprefix with commonpath (which does proper path component comparison), confirming this was the vulnerable code path. The PoC demonstrates how this character-based comparison fails when sibling resources share the static directory's prefix.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry W**n usin* `St*ti**il*s`, i* t**r*'s * *il* or *ir**tory t**t st*rts wit* t** s*m* n*m* *s t** `St*ti**il*s` *ir**tory, t**t *il* or *ir**tory is *lso *xpos** vi* `St*ti**il*s` w*i** is * p*t* tr*v*rs*l vuln*r**ility. ### **t*ils T** roo

Reasoning

T** vuln*r**ility st*ms *rom t** us* o* os.p*t*.*ommonpr**ix() in t** p*t* v*li**tion lo*i*. T** Pyt*on *o*um*nt*tion *xpli*itly st*t*s t*is *un*tion *o*s not ***ount *or p*t* *ompon*nts, m*kin* it unsuit**l* *or s**urity ****ks. T** *ommit *i** s*ow