Description
Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. 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 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| vitejs | vite | >= 6.2.0, < 6.2.4, >= 6.1.0, < 6.1.3, >= 6.0.0, < 6.0.13, >= 5.0.0, < 5.4.16, < 4.5.11 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 4 repositories
-
sunhuiHi666/CVE-2025-31125 ★ 6 · Apr 1, 2025
Vite 任意文件读取漏洞POC
-
harshgupptaa/Path-Transversal-CVE-2025-31125- ★ 0 · Jul 13, 2025
Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. Only apps explicitly exposing the Vite dev server to the network (u…
-
0xgh057r3c0n/CVE-2025-31125 ★ 0 · May 7, 2025
Vite WASM Import Path Traversal 🛡️
-
MuhammadWaseem29/Vitejs-exploit ★ 0 · May 3, 2025
Vite Development Server's @fs endpoint (CVE-2025-31125) to access sensitive files like /etc/passwd and /etc/hosts via crafted URLs.
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Automated scanner template
A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.
- Vite Development Server - Path Traversal http/cves/2025/CVE-2025-31125.yaml
Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | vite | >= 6.2.0, < 6.2.4 | 6.2.4 | GHSA-4r4m-qw57-chr8 |
| npm | vite | >= 6.1.0, < 6.1.3 | 6.1.3 | GHSA-4r4m-qw57-chr8 |
| npm | vite | >= 6.0.0, < 6.0.13 | 6.0.13 | GHSA-4r4m-qw57-chr8 |
| npm | vite | >= 5.0.0, < 5.4.16 | 5.4.16 | GHSA-4r4m-qw57-chr8 |
| npm | vite | < 4.5.11 | 4.5.11 | GHSA-4r4m-qw57-chr8 |