Vite Patches Critical CVSS 9.1 Dev-Server RCE in Virtual Module Resolver, GHSA-p4f5-76q4-ffq7
A GitHub security advisory describes a critical remote-code-execution flaw in Vite's dev server, reachable only when the server is exposed with --host, fixed in five release lines.
Editor's Note ·
- Correction:
- The Context section states: "Both sets of advisories describe the same underlying condition for exposure: a dev server reachable over the network through --host or the server.host option." This is not accurate for all three October advisories. Two of the three (file exposure outside server.fs.allow, and first-four-byte disclosure via ?vite-wasm-instance) do require the dev server to be exposed to the network with --host or server.host. The third, GHSA-9jrq-w75r-8gcw (cross-origin script execution), lists different conditions in its Impact section -- an unchanged request URL passed to server.transformIndexHtml, an inline module script in the transformed HTML, and sensitive values or critical actions reachable from the page -- and does not list network exposure via --host/server.host as a condition.
Overview
Vite’s project repository published a security advisory on GHSA-p4f5-76q4-ffq7, titled “Remote code execution using __vite-browser-external virtual module,” describing a flaw the advisory rates Critical with a CVSS 4.0 score of 9.1. According to the advisory, “by sending an HTTP request to the dev server, a arbitrary code execution was possible.” The advisory states the issue affects only apps that explicitly expose the Vite dev server to the network using --host or the server.host config option; a dev server left on localhost, a vite preview server, or a production build is not described as affected.
How the Flaw Works
Per the advisory, Vite’s resolver plugin generates stand-in “virtual modules” named __vite-browser-external:<suffix> and __vite-optional-peer-dep:<suffix> when the dev server cannot bundle something for the browser, such as a Node.js built-in. These modules embedded the module ID taken from the request URL “without escaping,” and the advisory says the suffix “can be any value, so any code was able to be injected in those modules.” The advisory describes two resulting problems: first, modules referenced by an injected module are allowed through the server.fs check, so an attacker-supplied import statement can pull in a file outside the allow list and read it; second, Vite uses eval to extract values for new Worker and import.meta.glob, which the advisory says let an attacker make Vite evaluate injected code on the server itself. The advisory notes Vite blocks some variable names like exports and require to avoid bugs, but that this is not a security boundary and can be bypassed with calls such as globalThis.process.getBuiltinModule. The advisory includes a proof of concept showing a file outside the allow list returning a 403 before the injection and its contents being returned afterward.
Patched Versions and Timing
The advisory lists patched versions of 8.3.7, 8.1.7, 7.3.8 and 6.4.6, plus vite-plus 1.5.1, and names 8.2.5 for the 8.2 line. The npm registry record for vite shows no 8.2.5 entry at all, while 8.2.6 was published to npm at 2026-11-09T11:00:12.866Z — meaning the fix that actually reached npm users on the 8.2 line is 8.2.6, not the 8.2.5 named in the advisory text. The same registry record timestamps the other npm-published fixes within about 40 minutes of each other on the morning of November 9, 2026 UTC: 8.3.7 at 10:25:29.212Z and 8.1.7 at 11:02:32.994Z. Vite’s own release notes for 8.3.7 record a matching publish timestamp of 2026-11-09T10:23:22Z. The GHSA record’s own published_at timestamp is 2026-11-10T01:35:55Z, roughly 15 hours after the npm releases. The advisory lists no CVE identifier. GitHub credits g2hsec, spansh, martinpriest and zooyeon as reporters.
The Rolldown Side of the Fix
The advisory attributes the vulnerable code on Vite 8 to Rolldown, the Rust-based bundler Vite 8 adopted, stating “the vulnerable code in v8 lives in the Rolldown binary” and that Vite 8.3.7 and 8.2.5 rely on a fix in Rolldown 1.2.17. Rolldown’s own release notes for 1.2.18 say that “v1.2.17 was published to crates.io only,” with its changes “released to npm” in 1.2.18 instead — which is the version Vite’s 8.3.7 release notes list as the dependency bump it ships. Rolldown’s 1.2.18 changelog lists the fix itself as “rolldown_plugin_vite_resolve: escape module names in generated error stubs,” matching the advisory’s description of the underlying bug.
Context
This is not the first Vite dev-server advisory in recent months: as previously reported, three medium- and low-severity dev-server advisories were published on October 6, 2026, patched in 8.3.3, 8.2.4, 8.1.6, 7.3.7 and 6.4.4 — earlier release-line versions than the fixes in this advisory. Both sets of advisories describe the same underlying condition for exposure: a dev server reachable over the network through --host or the server.host option.
What We Don’t Know
The GitHub advisory does not report confirmed exploitation of this flaw in the wild; it includes a proof of concept that demonstrates feasibility rather than documenting an observed attack. No CVE identifier has been assigned to GHSA-p4f5-76q4-ffq7 as of this writing.