Medium

Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance`

  • Disclosed: 21.10.2026
  • Updated: 21.10.2026 19:19

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 --host or the server.host option.
  • 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:

bash
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.

PlatformPackageVulnerable versionsFixed 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

CVSS score -
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

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (27) in the archive
Total entries
27
First → latest
08.2022 10.2026
Without a fix
0
Exploited in attacks
1

Severity breakdown

  • High 8
  • Medium 16
  • Low 3

Disclosures per year

  1. 2022: 1
  2. 2023: 2
  3. 2024: 4
  4. 2025: 9
  5. 2026: 11
Severity:
  1. Vite: First 4 bytes of files outside of `server.fs` setting is exposed by `?vite-wasm-instance` this entry
    Medium CVE-2026-112947 >= 8.3.0, < 8.3.3, >= 8.2.0, < 8.2.4 8.3.3, 8.2.4
  2. High CVE-2026-112942 >= 8.3.0, < 8.3.3, >= 8.2.0, < 8.2.4, >= 8.0.0, < 8.1.6, >= 7.0.0, < 7.3.7, < 6.4.4 8.3.3, 8.2.4, 8.1.6, 7.3.7, 6.4.4
  3. High · 7.5 CVE-2026-53571 >= 8.0.0, < 8.0.16, >= 7.0.0, < 7.3.5, < 6.4.3 8.0.16, 7.3.5, 6.4.3
  4. High CVE-2026-39364 >= 8.0.0, < 8.0.5, >= 7.1.0, < 7.3.2 8.0.5, 7.3.2
  5. High CVE-2026-39363 >= 8.0.0, < 8.0.5, >= 7.0.0, < 7.3.2, >= 6.0.0, < 6.4.2 8.0.5, 7.3.2, 6.4.2
  6. High · 7.5 CVE-2024-23331 >= 2.7.0, < 2.9.17, >= 3.0.0, < 3.2.8, >= 4.0.0, < 4.5.2, >= 5.0.0, < 5.0.12 2.9.17, 3.2.8, 4.5.2, 5.0.12
  7. High · 7.5 CVE-2023-34092 < 2.9.16, >= 3.0.2, < 3.2.7, >= 4.0.0, < 4.0.5, >= 4.1.0, < 4.1.5, >= 4.2.0, < 4.2.3, >= 4.3.0, < 4.3.9 2.9.16, 3.2.7, 4.0.5, 4.1.5, 4.2.3, 4.3.9
  8. High · 8.6 CVE-2022-35204 < 2.9.13, >= 3.0.0-alpha.0, < 3.0.0-beta.4 2.9.13, 3.0.0-beta.4

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.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.