SecurityOnlineDo Son
Vite Dev Server flaw enables remote code execution
Security Online reports a critical remote code execution flaw in the Vite Dev Server, published with a PoC by maintainers and researchers. The vulnerability, rated CVSS v4.0 9.1, affects network-exposed dev servers and could allow an attacker to read private files or execute code on the host. A PoC is publicly available alongside a GitHub security advisory, and researchers g2hsec, spans h, martinpriest, and zooyeon are noted as reporting the bug. The article notes that there is currently no CVE ID assigned for this issue.
The root cause, classed as CWE-116, arises from unescaped virtual module IDs used by Vite’s resolver plugin. Specifically, the plugins generate code from request URLs for the virtual modules __vite-browser-external:<suffix> and __vite-optional-peer-dep:<suffix>, and failures to escape the <suffix> enable injection of raw code into a trusted module. This injection can bypass the server[.]fs allow-list, pulling private files outside the project root into the module graph.
Additionally, Vite’s use of eval to parse module values for new Worker and import.meta[.]glob can execute injected code, potentially allowing OS command execution on the Node.js host via globalThis.process[.]getBuiltinModule. The advisory lists affected Vite releases across five branches: Vite 8.x (8.3.0–8.3.6, 8.2.0–8.2.4, 8.0.0–8.1.6), Vite 7.x and older (7.0.0–7.3.7, 4.0.0–6.4.5), and Vite-Plus 1.5.0 and older.
Patches are in 8.3.7, 8.2.5, 8.1.7, 7.3.8, 6.4.6, and vite-plus 1.5.1; Rolldown upgrades to 1.2.17 and 1.1.7 accompany the fix. The article advises removing the --host flag and binding dev servers to localhost until lockfiles are updated, and notes that compromised environments should rotate local keys and .env secrets.