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?
- How does the vulnerability work?
- Which Vite versions are affected?
- Who is actually at risk?
- Is CVE-2026-140097 exploited in the wild?
- What did the earlier Vite scanning campaign look like?
- How does it compare with other Vite flaws this year?
- How do you detect exploitation attempts?
- How to fix and mitigate CVE-2026-140097
- Open questions
- The bottom line
- Sources
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.
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.
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
viteinstead 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.denybypass, 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.
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.
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:
- Any request path containing
__vite-browser-externalor__vite-optional-peer-dep. Legitimate browser traffic rarely requests these IDs directly. - Encoded quote, backtick, semicolon or newline characters (
%22,%60,%3B,%0A) in the suffix of those IDs. GET /@fs/requests for files outside your project root, particularly.env,.aws,.sshor/procpaths.
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:
- Find exposed dev servers. Search repositories for
--hostandserver.host, and scan your own address space for listening dev ports. Exposure decides urgency. - 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.
- Bind to localhost. Remove
--hostwhere it is not needed, and setserver.hostto127.0.0.1orlocalhost. For mobile testing, prefer a tunnel that you open briefly and close. - Never put a dev server on the internet. Serve the output of
vite buildfor staging and demos. If a team needs a shared dev environment, put it behind a VPN or an authenticating proxy. - 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.
- 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
- Vite security advisory GHSA-p4f5-76q4-ffq7 (CVE-2026-140097)
- Vite security advisory GHSA-qppr-rxr4-jjq2 (CVE-2026-140098)
- Vite security advisories list
- Ostorlab: Vite Dev Server RCE on Network-Exposed Hosts (CVE-2026-140097)
- Brandefense: CVE-2026-140097 fix and PoC status
- F5 Labs: Cloud takeover, mass scanning for exposed Vite endpoints (CVE-2026-39364)
- CSA Singapore alert AL-2026-124
- SANS ISC: Attempts to exploit exposed Vite installs (CVE-2025-30208)
- npm registry: vite package
This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.