Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance`GHSA-vfpm-58rq-9qcg
Fix: vitejs/vite#23655GHSA-vfpm-58rq-9qcg is a Path Traversal vulnerability in vite. A fix is available for vite — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-vfpm-58rq-9qcg.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
vitenpmvite-plusnpmDescription
Summary
The first 4 bytes of files outside of server.fs setting can be returned to the browser by a request containing ?vite-wasm-instance.
Impact
Only apps that match one of the following conditions are affected:
- explicitly expose the Vite dev server to the network using
--hostor theserver.hostoption - there's a file that has a sensitive information in the first 4 bytes
- uses Node.js or Deno to run Vite (if Bun is used, it is not affected)
Details
Requests containing the ?vite-wasm-instance query are handled by the internal Wasm plugin's load hook. The hook removes the query and reads the resulting path directly from disk, but the server.fs checks were not applied.
After reading the file, Vite attempts to parse it as WebAssembly. When that parse fails, Node and deno throws an error that contains the first 4 bytes of the file.
PoC
Create a denied file and start an affected Vite dev 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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | vite | ≥ 8.3.0&&< 8.3.3 | 8.3.3npm install vite@8.3.3 |
| 📦npm | vite | ≥ 8.2.0&&< 8.2.4 | 8.2.4npm install vite@8.2.4 |
| 📦npm | vite-plus | ≥ 0.2.8&&< 1.1.0 | 1.1.0npm install vite-plus@1.1.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for vite, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update vite to 8.3.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-vfpm-58rq-9qcg is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Frequently Asked Questions
Is GHSA-vfpm-58rq-9qcg in your dependencies?
Find it across npm, including transitive dependencies.