
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-140097 is a critical remote code execution vulnerability in the Vite JavaScript frontend tooling framework, caused by improper encoding or escaping of output (CWE-116) in the __vite-browser-external and __vite-optional-peer-dep virtual modules. Affecting Vite versions 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, as well as vite-plus prior to 1.5.1, the vulnerability was disclosed on November 10, 2026 via a GitHub Security Advisory. It carries a CVSS v4.0 base score of 9.1 (Critical) (GitHub Advisory).
The root cause is that Vite's resolver plugin embeds request-derived module identifiers from the __vite-browser-external:<suffix> and __vite-optional-peer-dep:<suffix> virtual modules directly into generated JavaScript without proper escaping (CWE-116). Because Vite trusts the generated module code, an attacker can craft a malicious HTTP request to the /@id/ endpoint with a suffix that breaks out of the virtual module template, injecting arbitrary JavaScript including import statements. This injection has two exploitation paths: first, any file referenced by an injected import is added to the server.fs allow list, bypassing file access restrictions; second, Vite's use of eval for new Worker and import.meta.glob processing allows the injected code to be evaluated server-side, with sandbox bypasses available via globalThis.process.getBuiltinModule. In Vite v8, the vulnerable code resides in the Rolldown binary and was fixed in Rolldown 1.1.7 (for Vite 8.1.7) and Rolldown 1.2.17 (for Vite 8.2.5 and 8.3.7) (GitHub Advisory, Fix PR #24043, Fix PR #24044).
Successful exploitation allows an unauthenticated remote attacker to read arbitrary local files outside the server.fs allow list and execute arbitrary code in the development-server process. Confidentiality is severely impacted through disclosure of sensitive files (e.g., credentials, environment files, source code) accessible on the server's filesystem, and integrity is compromised through arbitrary code execution running as the Vite dev server process. Availability is not directly impacted per the CVSS scoring, but code execution could enable further lateral movement or persistence on the developer's machine (GitHub Advisory).
A proof-of-concept exploit is publicly documented in the GitHub Security Advisory (GHSA-p4f5-76q4-ffq7), demonstrating the file read primitive via crafted HTTP requests. The vulnerability requires no authentication and no user interaction, but does require the Vite dev server to be network-exposed (via --host or server.host configuration). There is no evidence of in-the-wild exploitation at the time of disclosure, and no threat actor attribution has been reported. The EPSS score is 0.0 and the vulnerability is not listed in the CISA KEV catalog (GitHub Advisory, Feedly).
--host or server.host enabled) on the target network using port scanning tools such as Nmap or Shodan, targeting the default Vite dev server port (5173).GET /@fs/tmp/decoy-secret.txt — a correctly configured server returns 403 Restricted ("outside of Vite serving allow list")./@id/ endpoint with a percent-encoded payload that breaks out of the virtual module template and injects an import statement for the target file:GET /@id/__vite-browser-external:`);}});%0aimport '/@fs/tmp/decoy-secret.txt';%0avar z=new Proxy({}, {get(_, key) {throw new Error(`?importThis pulls the target file into the Vite module graph and adds it to the server.fs allow list.GET /@fs/tmp/decoy-secret.txt — the server now returns the file contents in the response body.eval-based processing (via new Worker or import.meta.glob) and uses globalThis.process.getBuiltinModule to access Node.js built-in modules, enabling arbitrary command execution on the server host (GitHub Advisory)./@id/__vite-browser-external: or /@id/__vite-optional-peer-dep: endpoints containing percent-encoded newlines (%0a) or JavaScript syntax characters (backticks, semicolons, import keywords) in the path./@fs/ paths for files outside the project root (e.g., /tmp/, /etc/, home directories) from unexpected source IPs./@id/ with unusually long or specially encoded path suffixes; HTTP 200 responses to /@fs/ paths that previously returned 403.sh, bash, curl, wget, python) indicating server-side code execution..env, SSH keys, credential files) outside the project root (GitHub Advisory).Upgrade Vite to one of the patched versions: 6.4.6, 7.3.8, 8.1.7, 8.2.5, or 8.3.7 depending on the branch in use. Users of vite-plus should upgrade to 1.5.1 or later. The fix applies proper JSON.stringify-based escaping to module identifiers before embedding them in generated JavaScript. As an immediate workaround, avoid exposing the Vite dev server to untrusted networks — do not use --host or set server.host unless strictly necessary, and restrict access to trusted networks only via firewall rules (GitHub Advisory, Fix PR #24044).
The advisory was published by Vite maintainer sapphi-red on November 10, 2026, and credited reporters g2hsec, spansh, martinpriest, and zooyeon. The fix was labeled p5-urgent in the Vite repository, indicating the highest priority for release. Community uptake of the patch was rapid, with multiple downstream projects (e.g., bootstrap, itbeard-site, ThreadPulse-Daily) merging the Vite 6.4.6 security update within days of disclosure (GitHub Advisory, Fix PR #24044).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."