Miggo Logo

CVE-2024-31207: Vite's `server.fs.deny` did not deny requests for patterns with directories.

5.9

CVSS Score
3.1

Basic Information

EPSS Score
0.29094%
Published
4/3/2024
Updated
4/4/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
vitenpm>= 2.7.0, <= 2.9.172.9.18
vitenpm>= 3.0.0, <= 3.2.83.2.10
vitenpm>= 4.0.0, <= 4.5.24.5.3
vitenpm>= 5.0.0, <= 5.0.125.0.13
vitenpm>= 5.1.0, <= 5.1.65.1.7
vitenpm>= 5.2.0, <= 5.2.55.2.6

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two key elements in static.ts: 1) The isFileServingAllowed() function's pattern matching implementation using problematic picomatch options, and 2) The _matchOptions configuration that enabled matchBase mode. The commit diff shows these were the specific elements modified in the patch - changing matchBase to false, adding dot: true, and modifying pattern handling. These changes directly address the documented issue where directory patterns in fs.deny were ineffective due to basename-only matching.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry [Vit* **v s*rv*r option](*ttps://vit*js.**v/*on*i*/s*rv*r-options.*tml#s*rv*r-*s-**ny) `s*rv*r.*s.**ny` *i* not **ny r*qu*sts *or p*tt*rns wit* *ir**tori*s. *n *x*mpl* o* su** * p*tt*rn is `/*oo/**/*`. ### Imp**t Only *pps s*ttin* * *ust

Reasoning

T** vuln*r**ility st*ms *rom two k*y *l*m*nts in `st*ti*.ts`: *) T** `is*il*S*rvin**llow**()` *un*tion's p*tt*rn m*t**in* impl*m*nt*tion usin* pro*l*m*ti* pi*om*t** options, *n* *) T** `_m*t**Options` *on*i*ur*tion t**t *n**l** m*t****s* mo**. T** *o