Vite: `server.fs.deny` bypassed with queries
Package
Affected versions
>= 8.0.0, <= 8.0.4
>= 7.1.0, <= 7.3.1
Patched versions
8.0.5
7.3.2
Description
Published to the GitHub Advisory Database
Apr 6, 2026
Reviewed
Apr 6, 2026
Published by the National Vulnerability Database
Apr 7, 2026
Last updated
Apr 7, 2026
Summary
The contents of files that are specified by
server.fs.denycan be returned to the browser.Impact
Only apps that match the following conditions are affected:
--hostorserver.hostconfig option)server.fs.allowserver.fs.denyDetails
On the Vite dev server, files that should be blocked by
server.fs.deny(e.g.,.env,*.crt) can be retrieved with HTTP 200 responses when query parameters such as?raw,?import&raw, or?import&url&inlineare appended.PoC
pnpm exec vite root --host 127.0.0.1 --port 5175 --strictPortserver.fs.denyis enforced (expect 403):curl -i http://127.0.0.1:5175/src/.env | head -n 20References