Vite [beta only]: files otuside `server.fs.allow` and not included in `server.fs.deny` can be served by two requests using `?worker`
Published 1 Dec 2026 · Updated 1 Dec 2026
Affected package
- Affected
- >=8.4.0-beta.1 <8.4.0-beta.2
- Fixed in
- 8.4.0-beta.2
npm install vite@8.4.0-beta.2Which vite does your project really install?
Works for private projects: the file is read in memory to run the scan and then dropped. Also reads yarn.lock, pnpm-lock.yaml or package.json.
Public repo?
Look after several JavaScript apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Details
> [!IMPORTANT] > This advisory only affects beta versions.
Summary
With 8.4.0-beta.1, the contents of files that are outside `server.fs.allow` and not included in `server.fs.deny` can be returned to the browser.
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 is not specified by server.fs.deny
- Uses v8.4.0-beta.1
Details
In 8.4.0-beta.1, a dev server can be made to serve any file outside server.fs.allow that is not matched by server.fs.deny, with two unauthenticated GET requests and no preconditions:
1. GET /@fs/<absolute-path>?worker&import. The worker plugin generates a WorkerWrapper module whose body embeds the request-chosen path, and in doing so registers the absolute path in config.environments.client.safeModulePaths.
2. GET /@fs/<absolute-path> 200 with the file content. The safeModulePaths check short-circuits before the fs.allow check.
Only server.fs.deny matches keep working after registration. ?sharedworker&import triggers the same flow, and ?wasm / ?init&import / ?source&import queries register .wasm files the same way.
This is new in 8.4. The poisoning write (fileToDevUrl → safeModulePaths.addId) was introduced by commit https://github.com/vitejs/vite/commit/e258ce140eef64cf89ff38c410125abd8726f274 (https://github.com/vitejs/vite/pull/23168).
PoC
Minimal reproduction (two requests):
# 1) Before registration — correctly denied
GET /@fs/etc/passwd
-> 403 Restricted ("The request id /etc/passwd is outside...")
# 2) Register the path via the worker query
GET /@fs/etc/passwd?worker&import
-> 200
-> body: export default function WorkerWrapper(options) {
return new Worker("/@fs/etc/passwd?worker_file&type=module", ...)
}
# 3) Read — now allowed
GET /@fs/etc/passwd
-> 200 (text/javascript)
-> body: root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:...Is GHSA-qppr-rxr4-jjq2 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.
More advisories for vite
- MediumCVE-2026-118662Vite: `server.fs.deny` bypassed with queries · 29 Oct 2026
- LowCVE-2026-112945Vite: Cross origin script execution through Vite custom middleware · 21 Oct 2026
- MediumCVE-2026-112946Vite: Files outside `server.fs.allow` could be served when project paths match system paths on non-Windows machine · 21 Oct 2026
- MediumCVE-2026-112947Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance` · 21 Oct 2026
- MediumCVE-2026-112944launch-editor: Editor CLI flag misinterpretation causing arbitrary command execution for some editors · 20 Oct 2026
- HighCVE-2026-112942launch-editor: `fs.existsSync()` existence check can be bypassed on Windows · 20 Oct 2026
References
- Linkgithub.com/vitejs/vite/security/advisories/GHSA-qppr-rxr4-jjq2
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-140098
- Linkgithub.com/vitejs/vite/pull/23168
- Linkgithub.com/vitejs/vite/pull/24206
- Linkgithub.com/vitejs/vite/commit/a78fb8a28db01e83611120012bd5d1189bab68aa
- Linkgithub.com/vitejs/vite/commit/e258ce140eef64cf89ff38c410125abd8726f274
- Packagegithub.com/vitejs/vite
- Linkgithub.com/vitejs/vite/releases/tag/v8.4.0-beta.2
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.