GitHub Advisoryadvisory · npm
GHSA-4w7w-66w2-5vf9 Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling
MEDIUM
Official page ↗
- Aliases
- CVE-2026-39365
- Ecosystem
- npm
- Packages
- vite
- Severity
- Moderate
- CVSS vector
- CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
- Weaknesses
- CWE-200, CWE-22
- Reviewed
- 2026-04-06
Affected packages
• npm vite: >= 8.0.0, < 8.0.5 → fixed in 8.0.5
• npm vite: >= 7.0.0, < 7.3.2 → fixed in 7.3.2
• npm vite: < 6.4.2 → fixed in 6.4.2
Description
Summary
Any files ending with `.map` even out side the project can be returned to the browser.
Impact
Only apps that match the following conditions are affected:
• explicitly exposes the Vite dev server to the network (using `--host` or `server.host` config option)
• have a sensitive content in files ending with `.map` and the path is predictable
Details
In Vite v7.3.1, the dev server’s handling of `.map` requests for optimized dependencies resolves file paths and calls `readFile` without restricting `../` segments in the URL. As a result, it is possible to bypass the `server.fs.strict` allow list and retrieve `.map` files located outside the project root, provided they can be parsed as valid source map JSON.
PoC
1. Create a minimal PoC sourcemap outside the project root
```bash
cat > /tmp/poc.map
4. Inject `../` segments under the optimized deps `.map` URL prefix to reach `/tmp/poc.map`
Related
Alias · CVE (1)
- CVE-2026-39365 Vite is a frontend tooling framework for JavaScript. vulnerability
References
- https://github.com/vitejs/vite/security/advisories/GHSA-4w7w-66w2-5vf9 web
- https://nvd.nist.gov/vuln/detail/CVE-2026-39365 advisory
- https://github.com/vitejs/vite/pull/22161 web
- https://github.com/vitejs/vite/commit/79f002f2286c03c88c7b74c511c7f9fc6dc46694 web
- https://github.com/vitejs/vite package
- https://github.com/vitejs/vite/releases/tag/v6.4.2 web
- https://github.com/vitejs/vite/releases/tag/v7.3.2 web
- https://github.com/vitejs/vite/releases/tag/v8.0.5 web