Vite allows server.fs.deny to be bypassed with .svg or relative paths
CVE-2025-31486Published 3 Apr 2025, 18:24 UTC
Real-world risk
2.5/ 10Low
Routine
PreliminaryFrom the CVSS vector only · confidence low
CVSS
5.3
scored by the vendor (CNA), CVSS 3.1
In plain words
No plain-language summary yet. The original description is below.
Original description (from GitHub_M)
Vite is a frontend tooling framework for javascript. The contents of arbitrary files can be returned to the browser. By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the server.fs.deny restriction was able to bypass. This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 4.5.12, 5.4.17, 6.0.14, 6.1.4, and 6.2.5.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| ViteUbiquitous | < 4.5.12; >=5.0.0, < 5.4.17; >=6.0.0, < 6.0.14; >=6.1.0, < 6.1.4; >=6.2.0, < 6.2.5 | 4.5.12, 5.4.17, 6.0.14, 6.1.4, 6.2.5 |
What to do
Update to a fixed version: 4.5.12, 5.4.17, 6.0.14, 6.1.4, 6.2.5.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | Major data exposureReads secrets, credentials, databases, arbitrary files | From the CVSS vector | 0.80 |
| Attacker position | InternetAnyone on the Internet can reach a typical deployment | From the CVSS vector | 1.00 |
| Privileges needed | NoneNo account | From the CVSS vector | 1.00 |
| Victim interaction | RoutineA normal action: open a file, visit a page, click a link | From the CVSS vector | 0.70 |
| Configuration | DefaultOut-of-the-box installs are vulnerable | From the CVSS vector | 1.00 |
| Reliability | HardNarrow race, needs an extra info leak, needs a man-in-the-middle position, or must be chained with another bug | From the CVSS vector | 0.45 |
Threat level T4: Weaponized (× 1.00)
A Metasploit module, a Nuclei template, or a verified Exploit-DB entry
- Public proof of concept on GitHub
- Nuclei scanner template (link)
- Reference tagged as exploit (link)
- CISA SSVC: proof of concept
EPSS 40.5% chance of exploitation in 30 days (percentile 99), as of 2026-12-02.
The arithmetic
- Prerequisites multiplied together0.315
- Threat T4: Weaponized1.000
- 10 × impact 0.8 × prerequisites 0.315 × threat 12.520
- Rounded to one decimal between 0.1 and 102.5
Exploitation and evidence timeline
- 3 Apr 2025 Published
- 3 Dec 2026 Public proof of concept on GitHub first seen
- 3 Dec 2026 Nuclei scanner template first seen
- 3 Dec 2026 Reference tagged as exploit first seen
- 3 Dec 2026 CISA SSVC: proof of concept first seen
- 3 Dec 2026 Risk 2.5 (cvss fallback)
Weakness
CWE-200, CWE-284
References
- https://github.com/vitejs/vite/security/advisories/GHSA-xcj6-pq6g-qj4xexploit, vendor-advisory
- https://github.com/vitejs/vite/commit/62d7e81ee189d65899bb65f3263ddbd85247b647misc
- https://github.com/vitejs/vite/blob/037f801075ec35bb6e52145d659f71a23813c48f/packages/vite/src/node/plugins/asset.ts#L285-L290misc
- CVE-2025-31486 on CVE.org