{"id":"CVE-2025-46565","aliases":["CVE-2025-46565","GHSA-859w-5945-r5v3"],"related":[],"kind":"vulnerability","state":"published","title":"Vite's server.fs.deny bypassed with /. for files under project root","summary":"Vite is a frontend tooling framework for javascript. Prior to versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14, the contents of files in the project root that are denied by a file matching pattern can be returned to the browser. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. Only files that are under project root and are denied by a file matching pattern can be bypassed. `server.fs.deny` can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns). These patterns were able to bypass for files under `root` by using a combination of slash and dot (/.). This issue has been patched in versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Vite is a frontend tooling framework for javascript. Prior to versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14, the contents of files in the project root that are denied by a file matching pattern can be returned to the browser. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. Only files that are under project root and are denied by a file matching pattern can be bypassed. `server.fs.deny` can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns). These patterns were able to bypass for files under `root` by using a combination of slash and dot (/.). This issue has been patched in versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe contents of files in [the project `root`](https://vite.dev/config/shared-options.html#root) that are denied by a file matching pattern can be returned to the browser.\n\n### Impact\n\nOnly apps explicitly exposing the Vite dev server to the network (using --host or [server.host config option](https://vitejs.dev/config/server-options.html#server-host)) are affected.\nOnly files that are under [project `root`](https://vite.dev/config/shared-options.html#root) and are denied by a file matching pattern can be bypassed.\n\n- Examples of file matching patterns: `.env`, `.env.*`, `*.{crt,pem}`, `**/.env`\n- Examples of other patterns: `**/.git/**`, `.git/**`, `.git/**/*`\n\n### Details\n[`server.fs.deny`](https://vite.dev/config/server-options.html#server-fs-deny) can contain patterns matching against files (by default it includes `.env`, `.env.*`, `*.{crt,pem}` as such patterns).\nThese patterns were able to bypass for files under `root` by using a combination of slash and dot (`/.`).\n\n### PoC\n```\nnpm create vite@latest\ncd vite-project/\ncat \"secret\" > .env\nnpm install\nnpm run dev\ncurl --request-target /.env/. http://localhost:5173\n```\n\n![image](https://github.com/user-attachments/assets/822f4416-aa42-461f-8c95-a88d155e674b)\n![image](https://github.com/user-attachments/assets/42902144-863a-4afb-ac5b-fc16effa37cc)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Vite es un framework de herramientas frontend para JavaScript. En versiones anteriores a las 6.3.4, 6.2.7, 6.1.6, 5.4.19 y 4.5.14, el contenido de los archivos en la root del proyecto que se deniegan por un patrón de coincidencia de archivos se puede devolver al navegador. Solo las aplicaciones que exponen explícitamente el servidor de desarrollo de Vite a la red (mediante la opción de configuración --host o server.host) se ven afectadas. Solo se pueden omitir los archivos que se encuentran en la root del proyecto y se deniegan por un patrón de coincidencia de archivos. `server.fs.deny` puede contener patrones que coinciden con archivos (por defecto, incluye .env, .env.*, *.{crt,pem} como tales patrones). Estos patrones se podían omitir para los archivos en `root` mediante una combinación de barra diagonal y punto (/.). Este problema se ha solucionado en las versiones 6.3.4, 6.2.7, 6.1.6, 5.4.19 y 4.5.14.","source":"nvd"}],"published":"2025-04-30T17:40:27.000Z","modified":"2026-09-10T03:50:23.700Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/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"],"affected":[{"ranges":[{"version":">= 6.3.0, < 6.3.4","status":"affected"},{"version":">= 6.2.0, < 6.2.7","status":"affected"},{"version":">= 6.0.0, < 6.1.6","status":"affected"},{"version":">= 5.0.0, < 5.4.19","status":"affected"},{"version":"< 4.5.14","status":"affected"}],"vendor":"vitejs","product":"vite","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"6.3.0","status":"affected","fixed":"6.3.4"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"6.2.0","status":"affected","fixed":"6.2.7"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"6.0.0","status":"affected","fixed":"6.1.6"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"5.0.0","status":"affected","fixed":"5.4.19"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.5.14"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.5.14"},{"status":"affected","introduced":"5.0.0","fixed":"5.4.19"},{"status":"affected","introduced":"6.0.0","fixed":"6.1.6"},{"status":"affected","introduced":"6.2.0","fixed":"6.2.7"},{"status":"affected","introduced":"6.3.0","fixed":"6.3.4"}],"vendor":"vitejs","product":"vite","cpe":"cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/vitejs/vite/security/advisories/GHSA-859w-5945-r5v3","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/vite/commit/c22c43de612eebb6c182dd67850c24e4fab8cacb","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46565","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-05-02T17:38:51.291Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-46565","url":"https://www.cve.org/CVERecord?id=CVE-2025-46565","licence":"CVE Terms of Use","modified":"2025-05-02T17:38:55.291Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-859w-5945-r5v3","url":"https://github.com/advisories/GHSA-859w-5945-r5v3","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:23.700Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-46565","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46565","licence":"Public domain","modified":"2026-06-17T09:26:37.953Z"}],"updatedAt":"2026-11-25T22:58:57.370Z","epss":{"score":0.01268,"percentile":0.70599,"date":"2026-12-01T12:00:22.000Z"}}