{"id":"CVE-2025-46565","aliases":["GHSA-859w-5945-r5v3"],"url":"https://o3.security/vulnerability/CVE-2025-46565","summary":"Vite's server.fs.deny bypassed with /. for files under project root","details":"### 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)","published":"2025-05-01T17:20:29.773Z","modified":"2026-11-04T10:45:52.239859148Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"vite","fixedVersion":"6.3.4"},{"ecosystem":"npm","name":"vite","fixedVersion":"6.2.7"},{"ecosystem":"npm","name":"vite","fixedVersion":"6.1.6"},{"ecosystem":"npm","name":"vite","fixedVersion":"5.4.19"},{"ecosystem":"npm","name":"vite","fixedVersion":"4.5.14"}],"fix":{"url":"https://github.com/vitejs/vite/commit/c22c43de612eebb6c182dd67850c24e4fab8cacb","label":"vitejs/vite@c22c43d"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/46xxx/CVE-2025-46565.json"},{"type":"ADVISORY","url":"https://github.com/vitejs/vite/security/advisories/GHSA-859w-5945-r5v3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46565"},{"type":"FIX","url":"https://github.com/vitejs/vite/commit/c22c43de612eebb6c182dd67850c24e4fab8cacb"},{"type":"PACKAGE","url":"https://github.com/vitejs/vite"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-11-04T10:45:52.239859148Z"}}