TL;DR
Recently, Vite maintainers published full details and proof-of-concept (PoC) exploit code for a flaw. This critical Vite Dev Server RCE flaw scores 9.1 on the CVSS v4.0 scale and lets attackers read private files or run code. Teams exposing their dev server to a network must update to build 8.3.7, 8.2.5, 8.1.7, 7.3.8, or 6.4.6 now.
Why It Matters
Millions of web devs use Vite directly or via frameworks like Astro, Nuxt, SvelteKit, and Remix. By default, the dev server listens only on localhost and blocks outside traffic. However, many devs pass the --host flag or set server.host in Docker containers, cloud IDEs, and test boxes.
Per the GitHub security advisory, a single HTTP request can compromise an exposed dev server. Researchers g2hsec, spansh, martinpriest, and zooyeon reported the bug, which has no CVE ID yet. Although a working PoC exploit is public in the advisory, neither the maintainers nor CISA confirm broad attacks in the wild.
How the Attack Works
Unescaped Virtual Module IDs
Tracked as CWE-116, this Vite Dev Server RCE bug stems from missing output checks in Vite’s resolver plugin. Specifically, the __vite-browser-external:<suffix> and __vite-optional-peer-dep:<suffix> virtual modules build code from the request URL. Because the plugin did not escape the <suffix> string, an attacker can inject raw code into a trusted module.
File Read and Server Eval Bypass
Consequently, that injection creates two severe flaws. First, Vite lets any file imported by a trusted module bypass the server.fs allow-list check. Injecting an import line pulls private files outside the project root into the module graph for easy download. Second, Vite uses eval to parse module values for new Worker and import.meta.glob. Injected code reaches that eval call and uses globalThis.process.getBuiltinModule to run OS commands on the Node.js host.
Affected Versions
Vulnerable Vite and Vite-Plus Releases
This Vite Dev Server RCE flaw hits network-exposed dev servers across five branches.
- Vite 8.x: Builds 8.3.0 to 8.3.6, 8.2.0 to 8.2.4, and 8.0.0 to 8.1.6 (via the Rolldown binary).
- Vite 7.x and Older: Builds 7.0.0 to 7.3.7, and 4.0.0 to 6.4.5.
- Vite-Plus: Builds 1.5.0 and older.
Patch and Mitigation Steps
Maintainers fixed this Vite Dev Server RCE bug in Vite 8.3.7, 8.2.5, 8.1.7, 7.3.8, and 6.4.6, plus vite-plus 1.5.1. In Vite 8, the patch relies on Rolldown 1.2.17 and 1.1.7. Until devs update their lockfiles, they must remove the --host flag and bind dev servers only to localhost. Finally, teams that exposed a vulnerable dev server on an untrusted network should rotate local keys and .env secrets right away.
Support Our Threat Intelligence
Find our vulnerability reports and weekly recaps helpful? Support our work today and unlock a 100% ad-free reading experience!