CVE-2026-118662: Vite: `server.fs.deny` bypassed with queries
Vite 6.4.4 lets the dev server return files that `server.fs.deny` should block, such as `.env` or `*.crt`, when a query like `?raw` is appended to the URL. Only the 6.4.4 release is listed as vulnerable, and only dev servers exposed to the network are at risk. Upgrade to Vite 6.4.5.
Published Oct 29, 2026 · Analysis Oct 31, 2026
What an attacker can do
The server.fs.deny setting is Vite's list of file patterns the dev server must never serve. In 6.4.4, a request for a denied file that carries query parameters such as ?raw, ?import&raw or ?import&url&inline returns the file contents with HTTP 200. The cause is a back-port gap. Version 6.4.4 back-ported the fix from pull request 20410 for an earlier advisory, but that fix depends on pull request 22160, which was not back-ported. The v6 line was therefore left open to the earlier deny-list bypass, GHSA-v2wj-q39q-566r.
The advisory sets three conditions. The dev server is exposed to the network with --host or server.host. The sensitive file sits inside a directory allowed by server.fs.allow. A server.fs.deny pattern matches that file. Then anyone who can reach the dev server port can read secrets like .env values or certificate files by guessing the file name. The attacker needs no account. The CVSS 4.0 vector marks attack requirements as present and confidentiality impact as low on the vulnerable system.
Who is affected
Only Vite 6.4.4 is listed as vulnerable. Check the installed version:
npm ls viteYou are exposed only if you run the dev server (vite or vite dev) with --host or server.host set to a non-local address, and have sensitive files under the project root or another server.fs.allow directory. Production builds and the default localhost-only dev server do not meet the conditions.
vite
- Ecosystem
- npm
- Affected
- = 6.4.4
- Fixed in
- 6.4.5
- Check
npm ls vite
How to fix it
Upgrade to Vite 6.4.5.
npm install [email protected]The sources give no workaround beyond avoiding network exposure of the dev server: drop --host and server.host unless you need them, and keep secrets outside the allowed directories.
How to tell if you were hit
Look in dev server or reverse proxy logs for requests whose path ends in a denied file name plus a query such as .env?raw, .env?import&raw or ?import&url&inline that returned 200. Check whether the dev server was reachable from other machines on your network. If you find such requests, rotate any secrets stored in the files that were served.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to Hama1cco.
Questions
- Is Vite 6.4.3 or 6.3 affected by CVE-2026-118662?
The advisory lists only the exact version 6.4.4 as vulnerable, because the incomplete back-port landed in that release. Version 6.4.5 is the patched one.
- Does this affect production builds?
No source says so. The issue is in the dev server's
server.fs.denyhandling, and it needs the dev server exposed with--hostorserver.host.- Is it exploited in the wild?
The sources do not report exploitation, and it is not in CISA's KEV catalog.
References
Read for this analysis:
- https://nvd.nist.gov/vuln/detail/CVE-2026-118662
- https://github.com/vitejs/vite/pull/22160
- https://github.com/vitejs/vite/pull/23855
- https://github.com/vitejs/vite/commit/91e40d7bf9777057bbd31c3eb036a54c9465697e
- https://github.com/vitejs/vite/releases/tag/v6.4.5
- https://github.com/advisories/GHSA-8g5g-mxqh-grgj
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-112945
Vite: Cross origin script execution through Vite custom middleware
low2.1Oct 21, 2026CVE-2026-112946
Vite: Files outside `server.fs.allow` could be served when project paths match system paths on non-Windows machine
medium6.3Oct 21, 2026CVE-2026-112947
Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance`
medium6.3Oct 21, 2026CVE-2026-112942
launch-editor: `fs.existsSync()` existence check can be bypassed on Windows
high7.5Oct 20, 2026CVE-2026-112943
launch-editor: escapeCmdArgs() omits % escaping on Windows
medium6.3Oct 20, 2026CVE-2026-112944
launch-editor: Editor CLI flag misinterpretation causing arbitrary command execution for some editors
medium6.3Oct 20, 2026
