CVE-2025-31125: Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query
5.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.92994%
CWE
Published
3/31/2025
Updated
3/31/2025
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
vite | npm | >= 6.2.0, < 6.2.4 | 6.2.4 |
vite | npm | >= 6.1.0, < 6.1.3 | 6.1.3 |
vite | npm | >= 6.0.0, < 6.0.13 | 6.0.13 |
vite | npm | >= 5.0.0, < 5.4.16 | 5.4.16 |
vite | npm | < 4.5.11 | 4.5.11 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from incomplete query parameter validation in transformMiddleware. The patch shows:
- Addition of inlineRE regex pattern for 'inline' query param
- Expansion of the security check condition to include inlineRE.test()
- This indicates the original vulnerability allowed requests with ?inline/raw?import to bypass ensureServingAccess checks
- transformMiddleware is the primary request processing function that would appear in profiler when handling malicious URLs
- The function signature matches the middleware pattern shown in the patch diff where security checks are applied