cd /news/developer-tools/vite-remote-code-execution · home › topics › developer-tools › article
[ARTICLE · art-172408] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=↓ negative

Vite Remote Code Execution

Vite patched a remote code execution vulnerability in versions 8.3.7, 8.2.5 and 8.1.7, where unescaped module IDs in the `__vite-browser-external` and `__vite-optional-peer-dep` virtual modules let an attacker inject code into the dev server. The flaw only affects apps that expose the Vite dev server to the network via `--host` or the `server.host` config option, and the fix for the v8 code lives in Rolldown 1.2.17 (for Vite 8.3.7 and 8.2.5) and Rolldown 1.1.7 (for Vite 8.1.7). A proof of concept showed an injected `import '/@fs/tmp/decoy-secret.txt'` pulled a file outside the serving allow list into the module graph, after which a plain `GET /@fs/tmp/decoy-secret.txt` returned its contents.

recommendation

Upgrade to Vite 8.3.7, 8.2.5 or 8.1.7 and stop exposing the dev server via `--host`; the PoC read a file outside the allow list through an injected virtual-module import.

more in playbook: Securing agents and AI tools
read2 min views2 publishedNov 19, 2026
Vite Remote Code Execution
Image: Michielbdejong (auto-discovered)

Repository navigation #

This report was submitted with AI assistance

Description #

Summary

By sending an HTTP request to the dev server, a arbitrary code execution was possible.

Impact

Only apps that match the following condition are affected:

Details

Vite's resolver plugin has __vite-browser-external:<suffix> virtual module and __vite-optional-peer-dep:<suffix> virtual module. These modules embedded the module ID, which is derived from the URL, without escaping. The <suffix> can be any value, so any code was able to be injected in those modules.

Since Vite trusts the module code, there was two problems with this injection.

First, the modules referenced by a module are allowed for the server.fs check. For example, if the attacker injects import '/path/to/some-secret-file.txt', /path/to/some-secret-file.txt can be fetched.

Second, Vite uses eval to extract the value in the module code for new Worker and import.meta.glob. By using that functionality, the attacker can make Vite evaluate the injected code on the server. Vite prevents some module / global variables like exports, require to avoid bugs, but because this is not a security boundary, there's a bypass like globalThis.process.getBuiltinModule.

PoC

printf 'CANARY-SECRET-not-valid-js\n' > /tmp/decoy-secret.txt   # outside the project
vite

/tmp/decoy-secret.txt stands in for any sensitive file outside the allow list.

  1. Check that the target is correctly blocked. GET /@fs/tmp/decoy-secret.txt returns 403 Restricted ("outside of Vite serving allow list").
  2. Perform the injection. Send a request carrying the crafted id (it is shown decoded. \n are real newlines in the sent URL, percent-encoded on the wire): This pulls
GET /@id/__vite-browser-external:`);}});
import '/@fs/tmp/decoy-secret.txt';
var z=new Proxy({}, {get(_, key) {throw new Error(`?import

/tmp/decoy-secret.txt into the module graph. 3. Extract the file. GET /@fs/tmp/decoy-secret.txt returns the content in the body (CANARY-SECRET-not-valid-js ).

Notes on the fixes

The vulnerable code in v8 lives in the Rolldown binary. The code is only meant to be used by Vite and thus the report is not linked to Rolldown. Vite 8.3.7 and Vite 8.2.5 relies on the fix in Rolldown 1.2.17. Vite 8.1.7 relies on the fix in Rolldown 1.1.7.

── more in #developer-tools 4 stories · sorted by recency
── more on @vite 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/vite-remote-code-exe…] indexed:0 read:2min 2026-11-19 · —