CVE-2026-39363: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-39363 is an arbitrary file read vulnerability in the Vite JavaScript frontend tooling framework, caused by missing Origin header validation on the dev server's WebSocket interface. An unauthenticated, network-adjacent attacker can invoke the fetchModule function via the custom WebSocket event vite:invoke and use file:// URLs combined with ?raw or ?inline query parameters to retrieve arbitrary files from the server filesystem as JavaScript strings. Affected versions include Vite 6.0.0–6.4.1, 7.0.0–7.3.1, and 8.0.0–8.0.4, as well as vite-plus ≤0.1.15. The vulnerability was published on April 7, 2026, and carries a CVSS v3.1 score of 7.5 (High) and a CVSS v4.0 score of 8.2 (High) (GitHub Advisory, Red Hat Bugzilla).

Technical details

The root cause is a combination of CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor), CWE-306 (Missing Authentication for Critical Function), and CWE-1220 (Insufficient Granularity of Access Control). The Vite dev server exposes a WebSocket-based RPC mechanism that accepts vite:invoke events to call internal functions such as fetchModule. Because no Origin header validation is enforced on WebSocket connections, any network-reachable client can connect without authentication. The server.fs.allow access control list — which correctly blocks equivalent HTTP requests (e.g., /@fs/etc/passwd?raw returns HTTP 403) — is not applied to this WebSocket code path, allowing an attacker to bypass it entirely by sending a crafted fetchModule call with a file:// URL. Exploitation requires that the dev server is explicitly exposed to the network (via --host or server.host) and that WebSocket is not disabled (server.ws: false) (GitHub Advisory, Red Hat Bugzilla).

Impact

Successful exploitation allows an unauthenticated attacker to read the contents of arbitrary files on the server hosting the Vite dev server — including source code, environment files (.env), credentials, SSH keys, /etc/passwd, and other sensitive data — returned as JavaScript module strings. The impact is limited to confidentiality (no integrity or availability impact), but exposure of secrets or credentials could enable lateral movement or privilege escalation in CI/CD pipelines, development machines, or containerized environments. IBM API Connect is also listed as an affected downstream product (GitHub Advisory, IBM Advisory).

Exploitability

Public proof-of-concept exploit code is available in Python (exp.py) and Node.js (poc.js) on GitHub, with documented usage examples for reading arbitrary files via WebSocket RPC abuse (e.g., python exp.py -t localhost -p 5173 -f "C:/Windows/win.ini"). The official Vite security advisory also provides step-by-step reproduction instructions. As of the time of reporting, there is no confirmed evidence of in-the-wild exploitation, and no threat actor attribution has been made. The EPSS score is approximately 0.068% (low probability of near-term exploitation). The vulnerability is not currently listed in the CISA KEV catalog. Detection templates have been added to Nuclei, Qualys, and Nessus (GitHub PoC, GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify internet-facing or network-exposed Vite dev servers using tools like Shodan or Censys, looking for services on default port 5173. Confirm the target is running a vulnerable version (Vite 6.0.0–6.4.1, 7.0.0–7.3.1, or 8.0.0–8.0.4) and was started with --host 0.0.0.0 or equivalent.
  2. Confirm HTTP path is blocked: Send an HTTP request to verify that server.fs.allow is active: curl -i 'http://<target>:5173/@fs/etc/passwd?raw' — expect a 403 Restricted response.
  3. Establish WebSocket connection without Origin header: Connect to the Vite HMR WebSocket endpoint (e.g., ws://<target>:5173) without including an Origin header, bypassing any origin-based access control.
  4. Send malicious vite:invoke event: Transmit a WebSocket message invoking the fetchModule function via the vite:invoke event type, specifying a file:// URL to the target file with ?raw or ?inline appended (e.g., file:///etc/passwd?raw).
  5. Retrieve file contents: The server responds with the file contents wrapped as a JavaScript module string (e.g., export default "root:x:0:0:..."), completing the arbitrary file read.
  6. Automate exfiltration: Use the public exp.py or poc.js scripts to automate reading multiple files of interest (e.g., .env, SSH keys, application secrets) (GitHub PoC, GitHub Advisory).

Indicators of compromise

  • Network: Unexpected WebSocket connections to the Vite dev server port (default 5173) from external or untrusted IP addresses; WebSocket connections lacking an Origin header; outbound data transfers from the dev server to unknown hosts.
  • Logs: Vite dev server logs showing vite:invoke WebSocket events with fetchModule calls referencing file:// URLs or paths outside the project directory; repeated WebSocket connection attempts from a single IP.
  • File System: No direct file system artifacts from exploitation (read-only attack), but check for unexpected access to sensitive files such as .env, ~/.ssh/id_rsa, /etc/passwd, or application configuration files in server access logs.
  • Process: Unusual network activity from the Node.js process running the Vite dev server, particularly outbound connections not associated with normal HMR or build activity (GitHub Advisory).

Mitigation and workarounds

Upgrade Vite to a patched version: 6.4.2, 7.3.2, or 8.0.5 (or later); vite-plus users should upgrade to 0.1.16 or later. As an immediate workaround, disable WebSocket support by setting server.ws: false in the Vite config, or restrict network exposure by not using --host or server.host to bind the dev server to untrusted networks. If the dev server must be network-accessible, enforce Origin header validation at the network or reverse proxy level. Red Hat has addressed this in Red Hat Ansible Automation Platform via RHSA-2026:24761 and RHSA-2026:24762, and IBM has issued an advisory for IBM API Connect (GitHub Advisory, Red Hat Bugzilla, IBM Advisory).

Community reactions

The Vite security team (credited to sapphi-red, bluwy, and external reporters odgrso, CodeAnt-AI-Security, and tronglinh23) published the advisory on April 6, 2026, with patches released promptly. Red Hat triaged the issue as high severity and issued errata for Ansible Automation Platform within approximately two months. The vulnerability attracted attention on Bluesky and was indexed by multiple threat intelligence aggregators (Sangfor, VulDB, Sploitus, Vulners). ProjectDiscovery added Nuclei detection templates for the vulnerability across multiple template releases in April–May 2026, and the issue was included in ProjectDiscovery's April 2026 Nuclei templates blog post (GitHub Advisory, Red Hat Bugzilla).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

RHEL / CentOS

Affected

OpenShift

Not Affected

Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-966w-4vpf-p7hcHIGH7.1
  • JavaScript logoJavaScript
  • @aloma.io/aloma
NoYesOct 25, 2026
GHSA-mrwp-f3q8-3g9pMEDIUM5.9
  • JavaScript logoJavaScript
  • follow-redirects
NoYesOct 25, 2026
GHSA-hfm3-x63j-7fxpHIGHN/A
  • JavaScript logoJavaScript
  • @payload-auth-link/migrate
NoYesOct 25, 2026
GHSA-6244-vvv9-76f5MEDIUMN/A
  • JavaScript logoJavaScript
  • @payload-auth-link/plugin
NoYesOct 25, 2026
GHSA-q53q-qg98-p9jfHIGHN/A
  • JavaScript logoJavaScript
  • llm-fw
NoYesOct 25, 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