Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessConnect to exposed HMR WebSocket on port 5173
-
DeliverySend vitest:interceptor:register with opaque-scheme traversal URL
-
Exploitpath.join resolves redirect target outside project root
-
ExecutionAttacker requests virtual /mock module
-
Persistload hook calls readFile on traversed path
-
ImpactFile contents returned as module source to attacker
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the Vite HMR WebSocket port (default 5173) to be reachable from an untrusted network - by default Vite binds to localhost only, so this is not reachable remotely unless the developer starts the server with |
| Impact | The CVSS 5.9 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N) is well-calibrated. AC:H reflects a genuine exploitation prerequisite: the attacker must use an opaque URL scheme to prevent |
| Exploit ScenarioDerived | An attacker on the same network as a developer running |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 01, 2026
Path traversal in Vitest's interceptorPlugin exposes local files on any development server with a network-accessible HMR WebSocket. The vitest:interceptor:register handler in packages/mocker/src/node/interceptorPlugin.ts accepts redirect mock registrations over Vite's unauthenticated HMR socket without calling isFileLoadingAllowed(), allowing a remote unauthenticated attacker who can reach the dev server to submit opaque-scheme URLs (e.g., traversal:../../../etc/passwd) whose .. segments survive URL.pathname parsing and resolve outside the project root via path.join(). The plugin's load hook then returns readFile(mock.redirect, 'utf-8') as JavaScript module source, disclosing any file readable by the dev-server process. No public exploit or CISA KEV listing has been identified, but the GitHub fix PR includes a complete, working e2e test that serves as a functional PoC.
RemediationAI
Vendor-released patches are confirmed at Vitest 4.1.11 (https://github.com/vitest-dev/vitest/releases/tag/v4.1.11) and 5.0.0-rc.2 (https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.2), delivered via commits 51edf2b072902aec6d30c90ebaafd8f121c6f9d8, 8ff9b9a9efca7c6cfd5243569440de8d7a33aec4, and fe5a11d3ceac5ec10d6d7d21a46d4caca132c48f. Upgrade to 4.1.11 (stable) or 5.0.0-rc.2 (release candidate) immediately. As an interim compensating control pending upgrade, ensure Vite dev servers are not started with --host 0.0.0.0 or server.host: true, and use firewall rules or network policy to restrict the HMR WebSocket port (default 5173) to trusted hosts only - note that this does not fix the underlying code path and should not substitute for patching. If using browser mode, confirm that the token-authenticated RPC path is in use and that the unauthenticated WebSocket path is not reachable externally. The advisory is at https://github.com/vitest-dev/vitest/security/advisories/GHSA-82fw-gwwq-j7x9.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 5 packages in npm, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Vitest (CPE: cpe:2.3:a:vitest-dev:vitest) ships an @vitest/mocker subpackage (CPE: cpe:2.3:a:@vitest:mocker) that implements redirect mocking: a virtual module can be transparently substituted with the contents of another file at dev-server runtime. The interceptorPlugin() and mockerPlugin() exports register a vitest:interceptor:register WebSocket event handler on Vite's HMR socket in configureServer. This handler calls join(server.config.root, redirectUrl.pathname) to resolve the target path, but omits the isFileLoadingAllowed(server.config, redirect) boundary check that Vite's own static file middleware enforces via server.fs.allow and server.fs.deny. CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) is the root cause: when the redirect URL uses an opaque scheme (non-http/file prefix), the WHATWG URL parser stores the full literal path - including .. segments - in pathname, which path.join() then resolves relative to the project root, escaping it. The fix (commits 51edf2b, 8ff9b9a, fe5a11d) adds the missing isFileLoadingAllowed call and also adds registerWebSocketEvents: false to the browser mode path, which instead routes mocks through a token-authenticated RPC channel.
Know when Vitest gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
AV:N because the exploited WebSocket is network-reachable when exposed; AC:H for the opaque URL scheme requirement; PR:N since the HMR socket is unauthenticated; C:H for arbitrary local file read; I:N/A:N as only disclosure occurs.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
Vitest is a testing framework powered by Vite. From 2.1.0 until 4.1.11 and 5.0.0-rc.2, the public mockerPlugin and standalone interceptorPlugin exports in packages/mocker/src/node/interceptorPlugin.ts register the vitest:interceptor:register handler on Vite's unauthenticated HMR WebSocket without validating redirect targets against the file-serving allowlist. The implementation processes event.redirect without enforcing server.fs.allow and server.fs.deny through isFileLoadingAllowed. A remote client that can reach an exposed development server can submit an opaque URL scheme preserving .. segments, causing join(server.config.root, redirectUrl.pathname) to resolve outside the project root. The plugin's load hook then returns readFile(mock.redirect, 'utf-8') as module source, disclosing local files readable by the dev-server process. Vitest browser mode uses a token-authenticated RPC and is not remotely unauthenticated by default, although the same boundary check was missing on that path. This issue is fixed in versions 4.1.11 and 5.0.0-rc.2.
Blast Radius
ecosystem impact- 3 npm packages depend on @vitest/mocker (2 direct, 1 indirect)
- 1 npm packages depend on vitest (1 direct, 0 indirect)
Ecosystem-wide dependent count for version 2.1.0 and other introduced versions.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Vitest is a testing framework powered by Vite. Rated critical severity (CVSS 9.6), this vulnerability is remotely exploi
Vitest is a testing framework powered by Vite. Rated medium severity (CVSS 5.9), this vulnerability is remotely exploita
Path traversal in Vitest Browser Mode (@vitest/browser) lets any client reachable via the Browser Mode API read, create,
Vitest dev servers in versions 5.0.0-beta.6 through 5.0.4 misapply Vite's server.fs.deny denylist, letting remote attack
A path-traversal information disclosure in Vitest's mocker interceptor plugin requires a Windows host running the Vite d
Vitest development servers running the @vitest/mocker interceptorPlugin can have attacker-controlled JavaScript injected
Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| SUSE Linux Enterprise Module for Package Hub 15 SP7 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Manager Client Tools 15 | Affected |
| SUSE Manager Client Tools for SLE 15 | Affected |
| SUSE Multi-Linux Manager Client Tools for SLE 15 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Manager Proxy Module 4.3 | Affected |
| SUSE Enterprise Storage 6 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP6 | Affected |
| SUSE Manager Proxy LTS 4.3 | Affected |
| SUSE Manager Proxy Module 4.1 | Affected |
| SUSE Manager Proxy Module 4.2 | Affected |
| openSUSE Leap 15.3 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
| SUSE Multi Linux Manager Tools SLE-15 | Affected |
| ses/7.1/ceph/prometheus-server ses/7/ceph/prometheus-server suse/multi-linux-manager/5.2/x86_64/monitoring-prometheus | Affected |
EUVD-2026-69705
GHSA-82fw-gwwq-j7x9
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB