Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseCVE-2026-140097

CVE-2026-140097: 
JavaScript vulnerability analysis and mitigation

Overview

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).

Technical details

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).

Impact

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).

Exploitability

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).

Exploitation steps

  1. Reconnaissance: Identify network-exposed Vite development servers (running with --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).
  2. Verify file access restriction: Confirm the target file is blocked by sending GET /@fs/tmp/decoy-secret.txt — a correctly configured server returns 403 Restricted ("outside of Vite serving allow list").
  3. Inject malicious module identifier: Send a crafted HTTP request to the /@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(`?import
    This pulls the target file into the Vite module graph and adds it to the server.fs allow list.
  4. Retrieve the restricted file: Send GET /@fs/tmp/decoy-secret.txt — the server now returns the file contents in the response body.
  5. Achieve server-side code execution (optional): Craft a payload that leverages Vite's 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).

Indicators of compromise

  • Network: Unusual HTTP GET requests to /@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.
  • Network: Repeated or anomalous requests to /@fs/ paths for files outside the project root (e.g., /tmp/, /etc/, home directories) from unexpected source IPs.
  • Logs: Vite dev server access logs showing requests to /@id/ with unusually long or specially encoded path suffixes; HTTP 200 responses to /@fs/ paths that previously returned 403.
  • Process: Unexpected child processes spawned by the Vite/Node.js dev server process (e.g., sh, bash, curl, wget, python) indicating server-side code execution.
  • File System: New or modified files in the project directory created by the Node.js process, or evidence of access to sensitive files (e.g., .env, SSH keys, credential files) outside the project root (GitHub Advisory).

Mitigation and workarounds

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).

Community reactions

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).

Additional resources


Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-140097CRITICAL9.1
  • JavaScript logoJavaScript
  • vite
NoYesNov 30, 2026
CVE-2026-140010HIGH8.7
  • JavaScript logoJavaScript
  • html-minifier
NoYesNov 30, 2026
CVE-2026-140008HIGH8.7
  • JavaScript logoJavaScript
  • minimatch
NoYesNov 30, 2026
CVE-2026-140102HIGH7.5
  • JavaScript logoJavaScript
  • http-proxy-middleware
NoNoNov 30, 2026
CVE-2026-140103MEDIUM5.4
  • JavaScript logoJavaScript
  • http-proxy-middleware
NoYesNov 30, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management