Vite CVE-2026-140097: Dev Server RCE, 270M Weekly Downloads

By 12 min read
Vite CVE-2026-140097, a critical remote code execution flaw in the Vite dev server

A front-end developer who types vite --host to test a page on their phone may have just put a remote code execution bug on the network. CVE-2026-140097, fixed by the Vite team on 9 November 2026 and published to NVD on 30 November, lets unauthenticated requests make an exposed Vite dev server read arbitrary files and run attacker code.

In short: Vite CVE-2026-140097 is a critical (CVSS v4.0 9.1) code injection flaw in the Vite development server that affects every release line from 4.0.0 onward until the November fixes, but only when the dev server is reachable over the network. Production sites built with vite build are not affected. Vite saw about 270 million npm downloads in the week to 30 November, so the hard part is finding the few exposed instances among them.

What is Vite CVE-2026-140097?

CVE-2026-140097 is an improper output escaping bug (CWE-116) in Vite’s dev server, tracked by the Vite team as advisory GHSA-p4f5-76q4-ffq7. The advisory’s own summary is blunt: an HTTP request to the dev server could lead to arbitrary code execution.

Vite is an open-source JavaScript build tool and development server used by frameworks such as Vue, Svelte and many React setups. Its GitHub repository had 84,252 stars and 9,430 forks on 1 December 2026, and it is MIT licensed. The dev server is the part developers run locally to get instant reloads while they write code.

The advisory credits four reporters: GitHub users g2hsec, spansh, martinpriest and zooyeon. GitHub, acting as the CVE Numbering Authority, scored it 9.1 under CVSS v4.0, with no privileges and no user interaction required.

Four headline figures for Vite CVE-2026-140097: CVSS 9.1, 270 million weekly downloads, six patched lines, no confirmed attacks
A critical score on a hugely popular package, with no confirmed attacks yet. Data: GitHub advisory, npm registry, Ostorlab.

How does the vulnerability work?

The flaw sits in two virtual modules inside Vite’s resolver. A virtual module is code Vite generates on the fly instead of reading it from disk. Vite uses __vite-browser-external to stand in for Node.js modules that cannot run in a browser, and __vite-optional-peer-dep for optional dependencies that are not installed.

Both modules take a suffix from the requested module ID, and that ID comes from the URL. According to the advisory, Vite embedded the suffix into the generated JavaScript without escaping it, and the suffix can be any value. Whoever controls the URL therefore controls part of a JavaScript file that Vite treats as its own trusted code.

Problem one: reading files outside the project

Vite’s dev server normally refuses to serve files outside an allow list, set by the server.fs.allow option. But files that a trusted module imports are added to what the server will serve. The advisory explains that injecting an import line into the virtual module pulls an outside file into the module graph, after which a normal request returns it. The PoC shows a file that first returns 403 Restricted and then returns its contents.

Problem two: running code on the server

Vite also uses eval on the server side to work out values for new Worker and import.meta.glob expressions in module code. Injected code that reaches that path is evaluated inside the dev server’s Node.js process. Vite hides some globals such as require, but the advisory notes this was never meant as a security boundary and could be bypassed through other built-in objects.

Ostorlab, which published a detailed analysis on 1 December 2026, places the bug in resolve.ts and esbuildDepPlugin.ts and says the fix wraps the ID in JSON.stringify, the standard way to turn a string into a safe JavaScript literal. In Vite 8 the vulnerable code lives in the Rolldown bundler binary, so the 8.x fixes depend on Rolldown 1.2.17 and 1.1.7.

Five-stage chain from an exposed Vite dev server to file read and code execution
The bug turns a URL into trusted module code, which then unlocks file reads and server-side evaluation. Data: Vite advisory GHSA-p4f5-76q4-ffq7.

Which Vite versions are affected?

The advisory lists six vulnerable ranges and a fixed release for each. Note the very long reach: every Vite release since 4.0.0 is included.

Package Vulnerable versions Fixed version
vite 4.0.0 to 6.4.5 6.4.6
vite 7.0.0 to 7.3.7 7.3.8
vite 8.0.0 to 8.1.6 8.1.7
vite 8.2.0 to 8.2.4 8.2.5 (see note)
vite 8.3.0 to 8.3.6 8.3.7
vite-plus 1.5.0 and earlier 1.5.1

Two details matter when you plan the upgrade.

There is no fixed 4.x or 5.x release

The first range runs from 4.0.0 straight through 6.4.5, and the only fix listed for it is 6.4.6. Projects still on Vite 4 or 5 have to move up a major version, which can mean framework plugin changes. Budget for that instead of waiting for a backport that the advisory does not promise.

The 8.2 fix version does not match npm

The advisory names 8.2.5 as the fix for the 8.2 line. When we checked the npm registry on 1 December 2026, there was no 8.2.5 at all: the release published on 9 November is 8.2.6. Install 8.2.6 or later on that line, and do not let a scanner that expects exactly 8.2.5 tell you that you are still exposed. npm shows 6.4.6, 7.3.8, 8.1.7, 8.2.6 and 8.3.7 all published on 9 November, and Vite 8.4.0 was released on 26 November.

Who is actually at risk?

Only people running the dev server where the network can reach it. Vite binds to localhost by default, so a developer who runs npm run dev on a laptop without changing anything is not exposed to remote attackers.

The advisory names the conditions: the server is started with --host or the server.host config option. Ostorlab adds a third route, a reverse proxy in front of the dev port. In practice, check these places first:

  • Shared staging or demo machines where someone runs vite instead of serving a build.
  • Containers and cloud development environments, where binding to all interfaces is often needed to reach the server at all.
  • Package scripts such as "dev": "vite --host" that were added once for mobile testing and never removed.
  • CI preview jobs that start a dev server and leave it running on a public address.

Ostorlab is explicit that the output of vite build and the vite preview command are not affected. A static site built by Vite and served from a CDN carries none of this code.

Why a dev server is worth attacking

The code runs as the user who started Vite, usually a developer or a CI account. Those accounts tend to hold exactly what attackers want: .env files, cloud credentials, Git tokens and SSH keys. We saw the same pattern in the React2Keys credential theft campaign, where one framework bug became 50,000 stolen keys, and in the easyDNS breach that exposed 600 AWS keys.

Is CVE-2026-140097 exploited in the wild?

Not as far as anyone has reported. Ostorlab says no exploitation in the wild had been reported, and Brandefense marks field exploitation as not confirmed as of 1 December 2026. Brandefense also checked the CISA KEV catalog version dated 30 November and did not find the CVE in it.

The proof of concept is public, though. The Vite advisory itself includes a working file-read demonstration against a decoy file. Brandefense says its monitoring found two dark-chat posts mentioning the CVE between 2 September and 1 December, which shows interest but not attacks.

Why history says not to wait

Exposed Vite dev servers have been a target all year:

  • On 2 April 2026, Johannes Ullrich of the SANS Internet Storm Center reported honeypot requests using the /@fs/ prefix and a ?raw?? suffix, matching the older CVE-2025-30208. The requests went after environment files and AWS credential files.
  • F5 Labs reported on 11 September that attacks on CVE-2026-39364, a server.fs.deny bypass, rose from 1,732 events across the previous three months to more than 32,000 events in August 2026 alone.
  • On 17 September, Singapore’s Cyber Security Agency issued alert AL-2026-124, saying CVE-2026-39364 was reportedly being actively exploited.
Timeline of Vite dev server attacks and advisories from April to November 2026
Every earlier Vite dev server file-read bug was scanned for within months. Data: SANS ISC, GitHub, F5 Labs, CSA Singapore.

What did the earlier Vite scanning campaign look like?

F5 Labs’ August data is the best public picture of who hunts for exposed Vite servers. It counted 807 attacks when grouped by session, and roughly 32,000 raw events. Most traffic came from Google Cloud address ranges starting 34. and 35., and the United States was the largest source country with 17,297 events.

The requests tried to read .env variants, /root/.aws/credentials, .aws/config, terraform.tfstate, serverless.yml, .azure/credentials, /etc/passwd and the process environment under /proc. F5 says the scanners rotated user agents that claimed to be Googlebot, GPTBot, ClaudeBot and other crawlers, and sent forged X-Forwarded-For headers.

Bar chart comparing Vite file-read attack events before and during August 2026
One month of scanning was about 18 times the previous three months combined. Data: F5 Labs.

Nothing in the sources links that campaign to CVE-2026-140097. The point is that the infrastructure and target lists already exist, and a scanner that looks for /@fs/ today needs only a new request pattern.

How does it compare with other Vite flaws this year?

The Vite repository published at least ten security advisories in 2026. Most are medium-severity bypasses of the file-serving restrictions. CVE-2026-140097 is the only one rated critical, because it adds code execution.

CVE GitHub advisory date Severity What it allows
CVE-2026-39363 6 Apr 2026 High Arbitrary file read via the dev server WebSocket
CVE-2026-39364 6 Apr 2026 Medium (GitHub), 7.5 per CSA server.fs.deny bypass with queries; mass-scanned
CVE-2026-53571 1 Jun 2026 Medium server.fs.deny bypass on Windows alternate paths
CVE-2026-112946 6 Oct 2026 Medium Files outside the allow list served when paths match
CVE-2026-118662 21 Oct 2026 Medium server.fs.deny bypass with queries on Vite 6
CVE-2026-140097 10 Nov 2026 Critical (9.1) File read and code execution via virtual modules
CVE-2026-140098 26 Nov 2026 Medium File read via ?worker, 8.4.0-beta.1 only

The newest entry, CVE-2026-140098, affects only the 8.4.0-beta.1 pre-release and is fixed in 8.4.0-beta.2. It is a reminder that the file-serving boundary keeps breaking in new places.

How do you detect exploitation attempts?

No vendor has published indicators of compromise for CVE-2026-140097, and none of the sources maps it to MITRE ATT&CK. The closest techniques are T1190 (Exploit Public-Facing Application) and T1552.001 (Credentials In Files); that mapping is ours, not a vendor’s.

Log sources to check

  • Access logs of any reverse proxy, load balancer or ingress in front of a dev server.
  • The terminal output or log file of the Vite process itself, which prints requests and errors.
  • Cloud flow logs, to find which hosts accepted connections on the dev port (5173 by default) from outside.

Patterns to search for

Ostorlab suggests these signals:

  1. Any request path containing __vite-browser-external or __vite-optional-peer-dep. Legitimate browser traffic rarely requests these IDs directly.
  2. Encoded quote, backtick, semicolon or newline characters (%22, %60, %3B, %0A) in the suffix of those IDs.
  3. GET /@fs/ requests for files outside your project root, particularly .env, .aws, .ssh or /proc paths.

From the F5 data, add HTTP/1.0 requests with Connection: close, crawler user agents that fail reverse DNS checks, and X-Forwarded-For headers on a dev server that should have no proxy at all.

If you find a hit

Treat the host as compromised if a vulnerable version was exposed and you see these patterns. Look at child processes of the Node.js process that ran Vite, outbound connections from it, and recent use of any credential that the developer account could read.

How to fix and mitigate CVE-2026-140097

In priority order:

  1. Find exposed dev servers. Search repositories for --host and server.host, and scan your own address space for listening dev ports. Exposure decides urgency.
  2. Upgrade Vite. Move to 6.4.6, 7.3.8, 8.1.7, 8.2.6, 8.3.7 or 8.4.0, and vite-plus 1.5.1. Projects on 4.x or 5.x must jump to 6.4.6 or later. Restart the dev server so the new code loads.
  3. Bind to localhost. Remove --host where it is not needed, and set server.host to 127.0.0.1 or localhost. For mobile testing, prefer a tunnel that you open briefly and close.
  4. Never put a dev server on the internet. Serve the output of vite build for staging and demos. If a team needs a shared dev environment, put it behind a VPN or an authenticating proxy.
  5. Rotate secrets if exposed. If a vulnerable server was reachable from untrusted networks, rotate every credential the user account could read, starting with cloud keys and Git tokens.
  6. Block the obvious. As a stopgap, F5 suggests a WAF rule for the /@fs/ path segment on anything that proxies to a dev server.

Our guide to Claude Code secrets leaking through settings files covers the same lesson from another angle: developer machines hold production keys, so their tooling deserves production care.

Open questions

  • How many servers are exposed? No source has published an internet-wide count of reachable Vite dev servers. Download numbers say nothing about exposure.
  • The 8.2.5 mismatch. The advisory names a version that does not exist on npm, while 8.2.6 was published the same day. The Vite team has not explained the gap in the advisory.
  • Severity outside GitHub. Only the CVSS v4.0 score of 9.1 is published. A CVSS v3.1 score, which many scanners still rely on, was not given in the advisory.
  • Exploitation status. The no-exploitation finding is current only to 1 December 2026, and the 3 weeks between fix and CVE publication gave attackers time to read the public advisory.

The bottom line

CVE-2026-140097 turns a network-exposed Vite dev server into remote code execution with a public proof of concept. Your production site is almost certainly fine; your staging boxes, containers and --host scripts may not be. Upgrade to a fixed release, bind dev servers to localhost, and rotate secrets on any host that was reachable while vulnerable.

Sources

This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.

Frequently asked questions

What is CVE-2026-140097?

CVE-2026-140097 is a critical vulnerability in the Vite JavaScript build tool's development server. Request-controlled module IDs were written into generated JavaScript without escaping, which lets an unauthenticated attacker read files outside the project and execute code on a network-exposed dev server.

Which Vite versions are vulnerable to CVE-2026-140097?

Vite 4.0.0 through 6.4.5, 7.0.0 through 7.3.7, 8.0.0 through 8.1.6, 8.2.0 through 8.2.4 and 8.3.0 through 8.3.6, plus vite-plus 1.5.0 and earlier. The advisory lists 6.4.6, 7.3.8, 8.1.7, 8.2.5, 8.3.7 and vite-plus 1.5.1 as fixed.

Is my production site affected by the Vite vulnerability?

Not if production serves the output of vite build from a normal web server or CDN. The flaw is in the dev server code path only. It matters when someone runs the dev server in a place the network can reach, which sometimes happens on staging hosts, cloud IDEs and demo boxes.

Is CVE-2026-140097 being exploited in the wild?

As of 1 December 2026, Ostorlab and Brandefense both report no confirmed in-the-wild exploitation, and the CVE was not in the CISA Known Exploited Vulnerabilities catalog. A proof of concept is public in the Vite advisory, and earlier Vite dev server flaws were mass-scanned within months.

How do I check if my Vite dev server is exposed?

Look for the --host flag in package.json scripts and for server.host in vite.config files, then check which address the process is listening on. Anything other than 127.0.0.1, ::1 or localhost, or any proxy that forwards to the dev port, should be treated as exposed.

How do I fix CVE-2026-140097?

Upgrade to the fixed release on your branch, such as 6.4.6, 7.3.8, 8.1.7 or 8.3.7, or move to 8.4.0, and restart the dev server. If you cannot upgrade immediately, bind the dev server to localhost and remove any proxy that publishes it.

What should I look for in logs for CVE-2026-140097?

Requests whose path contains __vite-browser-external or __vite-optional-peer-dep, especially with encoded quotes, backticks, semicolons or newlines in the suffix. Also look for /@fs/ requests that name files outside the project, such as .env files or cloud credential files.

What is the difference between CVE-2026-140097 and CVE-2026-39364?

CVE-2026-39364 is a high-severity file-read bypass of Vite's server.fs.deny list that F5 Labs saw mass-scanned in August 2026. CVE-2026-140097 is rated critical because it goes further: besides reading files, it can make the dev server evaluate attacker code.

Keep reading

ViteCVE-2026-140097JavaScript securityremote code executiondeveloper securitysecrets managementvulnerability management