{"id":"CVE-2026-39365","aliases":["CVE-2026-39365","GHSA-4w7w-66w2-5vf9"],"related":[],"kind":"vulnerability","state":"published","title":"Vite has a Path Traversal in Optimized Deps `.map` Handling","summary":"Vite is a frontend tooling framework for JavaScript. From 6.0.0 to before 6.4.2, 7.3.2, and 8.0.5, 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. This vulnerability is fixed in 6.4.2, 7.3.2, and 8.0.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Vite is a frontend tooling framework for JavaScript. From 6.0.0 to before 6.4.2, 7.3.2, and 8.0.5, 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. This vulnerability is fixed in 6.4.2, 7.3.2, and 8.0.5.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nAny files ending with `.map` even out side the project can be returned to the browser.\n\n### Impact\n\nOnly apps that match the following conditions are affected:\n\n- explicitly exposes the Vite dev server to the network (using `--host` or [`server.host` config option](https://vitejs.dev/config/server-options.html#server-host))\n- have a sensitive content in files ending with `.map` and the path is predictable\n\n### Details\n\nIn 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`](https://vite.dev/config/server-options#server-fs-strict) allow list and retrieve `.map` files located outside the project root, provided they can be parsed as valid source map JSON.\n\n### PoC\n1. Create a minimal PoC sourcemap outside the project root\n    ```bash\n    cat > /tmp/poc.map <<'EOF'\n    {\"version\":3,\"file\":\"x.js\",\"sources\":[],\"names\":[],\"mappings\":\"\"}\n    EOF\n    ```\n2. Start the Vite dev server (example)\n    ```bash\n    pnpm -C playground/fs-serve dev --host 127.0.0.1 --port 18080\n    ```\n3. Confirm that direct `/@fs` access is blocked by `strict` (returns 403)\n    <img width=\"4004\" height=\"1038\" alt=\"image\" src=\"https://github.com/user-attachments/assets/15a859a8-1dc6-4105-8d58-80527c0dd9ab\" />\n4. Inject `../` segments under the optimized deps `.map` URL prefix to reach `/tmp/poc.map`\n    <img width=\"2790\" height=\"846\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5d02957d-2e6a-4c45-9819-3f024e0e81f2\" />","format":"markdown","source":"ghsa"},{"lang":"es","text":"Vite es un framework de herramientas de frontend para JavaScript. Desde la versión 6.0.0 hasta antes de las versiones 6.4.2, 7.3.2 y 8.0.5, el manejo del servidor de desarrollo (dev server) de las solicitudes .map para dependencias optimizadas resuelve rutas de archivo y llama a readFile sin restringir los segmentos ../ en la URL. Como resultado, es posible eludir la lista de permitidos (allow list) server.fs.strict y recuperar archivos .map ubicados fuera de la raíz del proyecto, siempre que puedan ser analizados como JSON de mapa de origen (source map) válido. Esta vulnerabilidad se corrige en las versiones 6.4.2, 7.3.2 y 8.0.5.","source":"nvd"}],"published":"2026-04-06T18:03:46.000Z","modified":"2026-09-10T03:50:42.779Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-22","CWE-200"],"affected":[{"ranges":[{"version":">= 8.0.0, < 8.0.5","status":"affected"},{"version":">= 7.0.0, < 7.3.2","status":"affected"},{"version":">= 6.0.0, < 6.4.2","status":"affected"}],"vendor":"vitejs","product":"vite","source":"cvelist"},{"ranges":[{"version":"< 0.1.16","status":"affected"}],"vendor":"vitejs","product":"vite-plus","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"8.0.0","status":"affected","fixed":"8.0.5"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"7.0.0","status":"affected","fixed":"7.3.2"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.4.2"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"6.0.0","lastAffected":"6.4.1"},{"status":"affected","introduced":"7.0.0","lastAffected":"7.3.1"},{"status":"affected","introduced":"8.0.0","lastAffected":"8.0.4"}],"vendor":"vitejs","product":"vite","cpe":"cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*","source":"nvd"},{"ranges":[{"status":"affected","lastAffected":"0.1.15"}],"vendor":"voidzero","product":"vite+","cpe":"cpe:2.3:a:voidzero:vite\\+:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/vitejs/vite/security/advisories/GHSA-4w7w-66w2-5vf9","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-39365","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite/pull/22161","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite/commit/79f002f2286c03c88c7b74c511c7f9fc6dc46694","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite/releases/tag/v6.4.2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite/releases/tag/v7.3.2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite/releases/tag/v8.0.5","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-04-09T18:10:42.839Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-39365","url":"https://www.cve.org/CVERecord?id=CVE-2026-39365","licence":"CVE Terms of Use","modified":"2026-04-15T14:23:24.501Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4w7w-66w2-5vf9","url":"https://github.com/advisories/GHSA-4w7w-66w2-5vf9","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:42.779Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-39365","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-39365","licence":"Public domain","modified":"2026-07-24T21:10:00.143Z"}],"updatedAt":"2026-11-25T22:59:18.162Z","epss":{"score":0.00934,"percentile":0.61782,"date":"2026-12-01T12:00:22.000Z"}}