Vite middleware may serve files starting with the same name with the public directory
CVE-2025-58751Published 8 Sep 2025, 22:52 UTC
Real-world risk
0.9/ 10Low
Routine
If the vulnerable configuration applies to you: 2.1
PreliminaryFrom the CVSS vector only · confidence low
CVSS
2.3
scored by the vendor (CNA), CVSS 4.0
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. Prior to versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20, files starting with the same name with the public directory were served bypassing the `server.fs` settings. Only apps that explicitly expose the Vite dev server to the network (using --host or `server.host` config option), use the public directory feature (enabled by default), and have a symlink in the public directory are affected. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| ViteUbiquitous | < 5.4.20; >= 6.0.0, < 6.3.6; >= 7.0.0, < 7.0.7; >= 7.1.0, < 7.1.5 | 5.4.20, 6.3.6, 7.0.7, 7.1.5 |
What to do
Update to a fixed version: 5.4.20, 6.3.6, 7.0.7, 7.1.5.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | MinorReflected XSS, CSRF with low effect, open redirect, minor leak | From the CVSS vector | 0.30 |
| 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 | UncommonNeeds a non-default feature that a minority enables | From the CVSS vector | 0.45 |
| Reliability | ReliableDeterministic: injection, logic bug, path traversal | From the CVSS vector | 1.00 |
Threat level T4: Weaponized (× 1.00)
A Metasploit module, a Nuclei template, or a verified Exploit-DB entry
EPSS 1.4% chance of exploitation in 30 days (percentile 74), as of 2026-12-02.
The arithmetic
- Prerequisites multiplied together0.315
- Threat T4: Weaponized1.000
- 10 × impact 0.3 × prerequisites 0.315 × threat 10.945
- Rounded to one decimal between 0.1 and 100.9
Exploitation and evidence timeline
- 8 Sep 2025 Published
- 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 0.9 (cvss fallback)
Weakness
CWE-22, CWE-200, CWE-284
References
- https://github.com/vitejs/vite/security/advisories/GHSA-g4jq-h2w9-997cexploit, vendor-advisory
- https://github.com/lukeed/sirv/commit/f0113f3f8266328d804ee808f763a3c11f8997ebmisc
- https://github.com/vitejs/vite/commit/09f2b52e8d5907f26602653caf41b3a56692600dmisc
- https://github.com/vitejs/vite/commit/4f1c35bcbb5830290c694aa14b6789e07450f069misc
- https://github.com/vitejs/vite/commit/63e2a5d232218f3f8d852056751e609a5367aaecmisc
- https://github.com/vitejs/vite/commit/e11d24008b97d4ca731ecc1a3b95260a6d12e7e0misc
- CVE-2025-58751 on CVE.org