Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance`
Summary
The first 4 bytes of files outside of the server.fs setting can be returned to the browser by a request containing ?vite-wasm-instance.
Impact
Only applications that match the following conditions are affected:
- The Vite development server is explicitly exposed to the network using
--hostor theserver.hostoption. - A file contains sensitive information within its first 4 bytes.
- Vite is run using Node.js or Deno (applications running on Bun are not affected).
Details
Requests containing the ?vite-wasm-instance query are handled by the internal Wasm plugin's load hook. This hook removes the query and reads the resulting file path directly from disk, but server.fs checks were not applied.
After reading the file, Vite attempts to parse it as WebAssembly. When this parsing fails, Node.js and Deno throw an error that includes the first 4 bytes of the file.
PoC
Create a denied file and start an affected Vite development server:
echo 'SECRET_KEY=abc123\n' > .env
npm run dev
curl 'http://localhost:5173/.env?vite-wasm-instance'
This will show:
Failed to parse WASM file "<root>/.env": WebAssembly.compile(): expected magic word 00 61 73 6d, found 53 45 43 52 @+0
What to do
Update Vite to version 8.2.4, 8.3.3, or later, and update vite-plus to version 1.1.0 or later.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | vite | >= 8.3.0, < 8.3.3, >= 8.2.0, < 8.2.4 | 8.3.3, 8.2.4 |
| npm package | vite-plus | >= 0.2.8, < 1.1.0 | 1.1.0 |
References
- https://github.com/vitejs/vite/security/advisories/GHSA-vfpm-58rq-9qcg
- https://nvd.nist.gov/vuln/detail/CVE-2026-112947
- https://github.com/vitejs/vite/pull/23655
- https://github.com/vitejs/vite/commit/b6c6d2fb3f853aab4092dc25f0d6816a96c23dff
- https://github.com/vitejs/vite/commit/ba8b7ab43b4afa5d0292ab4b6e3a7b5033cc9c73
- https://github.com/vitejs/vite
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N- Weakness (CWE)
CWE-200, CWE-209, CWE-22- Platform
- npm
- Package
vite, vite-plus- Disclosed
- 21.10.2026
- Updated
- 21.10.2026 19:19
Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.
OSV / GitHub Advisory Database - GHSA-vfpm-58rq-9qcg - CC BY 4.0
Vulnerability history: vite-plus
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 9
- First → latest
- 04.2026 10.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 3
- Medium 4
- Low 1
Disclosures per year
- 2026: 9
-
Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance` this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.