{"id":"GHSA-859w-5945-r5v3","revision":"d5b0790d84c24ea6b1f2847d3b3397be","records":[{"revision":"d5b0790d84c24ea6b1f2847d3b3397be","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-859w-5945-r5v3","aliases":["CVE-2025-46565"],"title":"Vite's server.fs.deny bypassed with /. for files under project root","description":"### 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)","state":0,"publishedAt":"2025-04-30T17:40:27+00:00","modifiedAt":"2026-09-10T03:50:23.7009223+00:00","affected":[{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"6.3.0"},{"kind":"fixed","version":"6.3.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"6.2.0"},{"kind":"fixed","version":"6.2.7"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"6.0.0"},{"kind":"fixed","version":"6.1.6"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.0.0"},{"kind":"fixed","version":"5.4.19"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"4.5.14"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","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":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/vitejs/vite/security/advisories/GHSA-859w-5945-r5v3","https://nvd.nist.gov/vuln/detail/CVE-2025-46565","https://github.com/vitejs/vite/commit/c22c43de612eebb6c182dd67850c24e4fab8cacb","https://github.com/vitejs/vite"],"sourceUrl":"https://github.com/advisories/GHSA-859w-5945-r5v3","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-859w-5945-r5v3","identifiers":["GHSA-859w-5945-r5v3","CVE-2025-46565"]},"retained":false,"historicalAffected":[]}],"coverage":[]}