CVE-2026-39365: Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling
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…
Published Apr 6, 2026 · Updated Apr 7, 2026
Affected packages
vite
- Ecosystem
- npm
- Affected
- >= 8.0.0, <= 8.0.4
- Fixed in
- 8.0.5
- Check
npm ls vite
vite
- Ecosystem
- npm
- Affected
- >= 7.0.0, <= 7.3.1
- Fixed in
- 7.3.2
- Check
npm ls vite
vite
- Ecosystem
- npm
- Affected
- <= 6.4.1
- Fixed in
- 6.4.2
- Check
npm ls vite
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
--hostor `server.host` config option) - have a sensitive content in files ending with
.mapand 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
- Create a minimal PoC sourcemap outside the project root ``
bash cat > /tmp/poc.map <<'EOF' {"version":3,"file":"x.js","sources":[],"names":[],"mappings":""} EOF`` - Start the Vite dev server (example) ``
bash pnpm -C playground/fs-serve dev --host 127.0.0.1 --port 18080`` - Confirm that direct
/@fsaccess is blocked bystrict(returns 403)
- Inject
../segments under the optimized deps.mapURL prefix to reach/tmp/poc.map
Credited to odgrso, Ochk0, bluwy.
References
- https://github.com/vitejs/vite/security/advisories/GHSA-4w7w-66w2-5vf9
- https://github.com/vitejs/vite/pull/22161
- https://github.com/vitejs/vite/commit/79f002f2286c03c88c7b74c511c7f9fc6dc46694
- https://github.com/vitejs/vite/releases/tag/v6.4.2
- https://github.com/vitejs/vite/releases/tag/v7.3.2
- https://github.com/vitejs/vite/releases/tag/v8.0.5
- https://nvd.nist.gov/vuln/detail/CVE-2026-39365
- https://github.com/advisories/GHSA-4w7w-66w2-5vf9
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-118662
Vite: `server.fs.deny` bypassed with queries
medium6.9Oct 29, 2026CVE-2026-112945
Vite: Cross origin script execution through Vite custom middleware
low2.1Oct 21, 2026CVE-2026-112946
Vite: Files outside `server.fs.allow` could be served when project paths match system paths on non-Windows machine
medium6.3Oct 21, 2026CVE-2026-112947
Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance`
medium6.3Oct 21, 2026CVE-2026-112942
launch-editor: `fs.existsSync()` existence check can be bypassed on Windows
high7.5Oct 20, 2026CVE-2026-112943
launch-editor: escapeCmdArgs() omits % escaping on Windows
medium6.3Oct 20, 2026
