Summary
Vite: First 4 bytes of files outside of server.fs setting is exposed by ?vite-wasm-instance
The first 4 bytes of files outside of server.fs setting can be returned to the browser by a request containing ?vite-wasm-instance.
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
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)
Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
vite to 8.3.3 or later; vite to 8.2.4 or later; vite-plus to 1.1.0 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-112947? CVE-2026-112947 is a medium-severity path traversal vulnerability in vite (npm), affecting versions >= 8.3.0, <= 8.3.2. It is fixed in 8.3.3, 8.2.4, 1.1.0. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
- Which packages are affected by CVE-2026-112947?
vite(npm) (versions >= 8.3.0, <= 8.3.2)vite-plus(npm) (versions >= 0.2.8, <= 1.0.0)
- Is there a fix for CVE-2026-112947? Yes. CVE-2026-112947 is fixed in 8.3.3, 8.2.4, 1.1.0. Upgrade to this version or later.
- Is CVE-2026-112947 exploitable, and should I be worried? Whether CVE-2026-112947 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-112947 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-112947?
- Upgrade
viteto 8.3.3 or later - Upgrade
viteto 8.2.4 or later - Upgrade
vite-plusto 1.1.0 or later
- Upgrade