Description
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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| vitejs | vite | < 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 | — |
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 3 repositories
-
iSee857/CVE-2025-31486-PoC ★ 6 · Apr 7, 2025
Vite任意文件读取漏洞批量检测脚本CVE-2025-31486
-
hackmelocal/CVE-2025-31486-Simulation ★ 0 · Jul 24, 2025
-
ll104567/CVE-2025-31486 ★ 0 · Apr 26, 2025
CVE-2025-31486 poc
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 server.fs.deny Bypass - Local File Inclusion http/cves/2025/CVE-2025-31486.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.5 | 6.2.5 | GHSA-xcj6-pq6g-qj4x |
| npm | vite | >= 6.1.0, < 6.1.4 | 6.1.4 | GHSA-xcj6-pq6g-qj4x |
| npm | vite | >= 6.0.0, < 6.0.14 | 6.0.14 | GHSA-xcj6-pq6g-qj4x |
| npm | vite | >= 5.0.0, < 5.4.17 | 5.4.17 | GHSA-xcj6-pq6g-qj4x |
| npm | vite | < 4.5.12 | 4.5.12 | GHSA-xcj6-pq6g-qj4x |