GHSA-p4f5-76q4-ffq7: Resolver plugin virtual modules __vite-browser-external: and __vite-optional-peer-dep: (unescaped module ID)
The URL-derived module ID was embedded into Vite’s __vite-browser-external and __vite-optional-peer-dep virtual modules without escaping. Injected imports bypass the server.fs allow list (arbitrary file read), and Vite’s eval for new Worker / import.meta.glob executes injected code on the dev server; globalThis.process.getBuiltinModule bypasses the blocked globals.
Executive Summary & Technical Impact
The URL-derived module ID was embedded into Vite’s __vite-browser-external and __vite-optional-peer-dep virtual modules without escaping. Injected imports bypass the server.fs allow list (arbitrary file read), and Vite’s eval for new Worker / import.meta.glob executes injected code on the dev server; globalThis.process.getBuiltinModule bypasses the blocked globals.
Tracked under GHSA-p4f5-76q4-ffq7 (CWE-116 (Improper Encoding or Escaping of Output)), this vulnerability affects vite >=4.0.0 <=6.4.5, >=7.0.0 <=7.3.7, >=8.0.0 <=8.1.6, >=8.2.0 <=8.2.4, >=8.3.0 <=8.3.6; vite-plus <=1.5.0 (only when the dev server is exposed to the network) and carries a severity score of 9.1 (CRITICAL). Engineering and security operations teams running vite / vite-plus (npm) should prioritize upgrading to vite 8.3.7, 8.2.5, 8.1.7, 7.3.8, 6.4.6; vite-plus 1.5.1.
Remediation & Patch Guidance
- Upgrade vite to 8.3.7, 8.2.5, 8.1.7, 7.3.8 or 6.4.6 (vite-plus 1.5.1) and confirm the lockfile resolves the fixed version for framework-bundled Vite.
- Stop exposing dev servers with --host/server.host on shared or public networks; use an authenticated tunnel or vite preview for demos.
- Rotate secrets visible to any vulnerable dev server that was reachable from untrusted networks.
Frequently Asked Questions (GHSA-p4f5-76q4-ffq7)
What versions are affected by GHSA-p4f5-76q4-ffq7?
GHSA-p4f5-76q4-ffq7 affects vite >=4.0.0 <=6.4.5, >=7.0.0 <=7.3.7, >=8.0.0 <=8.1.6, >=8.2.0 <=8.2.4, >=8.3.0 <=8.3.6; vite-plus <=1.5.0 (only when the dev server is exposed to the network) in vite / vite-plus (npm) (Resolver plugin virtual modules __vite-browser-external: and __vite-optional-peer-dep: (unescaped module ID)).
How do I patch or remediate GHSA-p4f5-76q4-ffq7?
Upgrade affected deployments to vite 8.3.7, 8.2.5, 8.1.7, 7.3.8, 6.4.6; vite-plus 1.5.1 and verify the remediation steps listed above.
What is the CVSS score of GHSA-p4f5-76q4-ffq7?
GHSA-p4f5-76q4-ffq7 is rated CRITICAL with a CVSS score of 9.1 (vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N; HTTP requests to a dev server exposed with --host / server.host).
Vite Dev Server RCE (GHSA-p4f5-76q4-ffq7): One HTTP Request to an Exposed `vite --host` Runs Code on Your Machine
An unescaped module ID in the __vite-browser-external and __vite-optional-peer-dep virtual modules lets a network attacker read files outside the allow list and get eval'd code on the dev server. Vite 4.0 through 8.3.6 are affected; upgrade to 8.3.7, 8.2.5, 8.1.7, 7.3.8 or 6.4.6.
Read full engineering post-mortem (4 min read) →