Vite: `server.fs.deny` bypassed with queries
Published 29 Oct 2026 · Updated 29 Oct 2026
Affected package
- Affected
- >=6.4.4 <6.4.5
- Fixed in
- 6.4.5
npm install vite@6.4.5Details
Summary
The contents of files that are specified by `server.fs.deny` can be returned to the browser. This is the same as https://github.com/vitejs/vite/security/advisories/GHSA-v2wj-q39q-566r.
Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using
--hostor `server.host` config option) - the sensitive file exists in the allowed directories specified by `server.fs.allow`
- the sensitive file is denied with a pattern that matches a file by `server.fs.deny`
Details
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&inline are appended.
For the fix for https://github.com/vitejs/vite/security/advisories/GHSA-rq7h-c2jc-7f22, v6.4.4 back-ported https://github.com/vitejs/vite/pull/20410. But while that PR requires https://github.com/vitejs/vite/pull/22160 for https://github.com/vitejs/vite/security/advisories/GHSA-v2wj-q39q-566r, https://github.com/vitejs/vite/pull/22160 wasn't back-ported together causing v6 vulnerable to https://github.com/vitejs/vite/security/advisories/GHSA-v2wj-q39q-566r.
Is GHSA-8g5g-mxqh-grgj in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected vite, and gives you the command that fixes it.
References
- Linkgithub.com/vitejs/vite/security/advisories/GHSA-8g5g-mxqh-grgj
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-118662
- Linkgithub.com/vitejs/vite/pull/22160
- Linkgithub.com/vitejs/vite/pull/23855
- Linkgithub.com/vitejs/vite/commit/91e40d7bf9777057bbd31c3eb036a54c9465697e
- Packagegithub.com/vitejs/vite
- Linkgithub.com/vitejs/vite/releases/tag/v6.4.5
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.