Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Partial Red Hat: 8 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-22 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| vitest-dev | vitest | 2.1.0 to before 4.1.11; 5.0.0-beta.1 to before 5.0.0-rc.2 | 4.1.11, 5.0.0-rc.2 | Patch available | CNA |
| @vitest | mocker | 2.1.0 to before 4.1.11; 5.0.0-beta.1 to before 5.0.0-rc.2 | 4.1.11, 5.0.0-rc.2 | Patch available | CNA |
| — | @vitest/mocker (npm) | 2.1.0 to before 4.1.11 | 4.1.11 | Patch available | GHSA-82fw-gwwq-j7x9 |
| — | vitest (npm) | 2.1.0 to before 4.1.11 | 4.1.11 | Patch available | GHSA-82fw-gwwq-j7x9 |
| — | vitest (npm) | 5.0.0-beta.1 to before 5.0.0-rc.2 | 5.0.0-rc.2 | Patch available | GHSA-82fw-gwwq-j7x9 |
| — | @vitest/mocker (npm) | 5.0.0-beta.1 to before 5.0.0-rc.2 | 5.0.0-rc.2 | Patch available | GHSA-82fw-gwwq-j7x9 |
- vitest Vendorvitest-dev Affected 2.1.0 to before 4.1.11; 5.0.0-beta.1 to before 5.0.0-rc.2 Fixed in 4.1.11, 5.0.0-rc.2 Patch available CNA
- mocker Vendor@vitest Affected 2.1.0 to before 4.1.11; 5.0.0-beta.1 to before 5.0.0-rc.2 Fixed in 4.1.11, 5.0.0-rc.2 Patch available CNA
- @vitest/mocker (npm) Vendor— Affected 2.1.0 to before 4.1.11 Fixed in 4.1.11 Patch available GHSA-82fw-gwwq-j7x9
- vitest (npm) Vendor— Affected 2.1.0 to before 4.1.11 Fixed in 4.1.11 Patch available GHSA-82fw-gwwq-j7x9
- vitest (npm) Vendor— Affected 5.0.0-beta.1 to before 5.0.0-rc.2 Fixed in 5.0.0-rc.2 Patch available GHSA-82fw-gwwq-j7x9
- @vitest/mocker (npm) Vendor— Affected 5.0.0-beta.1 to before 5.0.0-rc.2 Fixed in 5.0.0-rc.2 Patch available GHSA-82fw-gwwq-j7x9
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:*:*:* | — | — | vitest-dev |
- cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:*:*:* Versions — — ·vitest-dev
Remediation
- Fix · CNA vitest (vitest-dev) Fixed in 4.1.11, 5.0.0-rc.2
- Fix · CNA mocker (@vitest) Fixed in 4.1.11, 5.0.0-rc.2
- Fix · GHSA-82fw-gwwq-j7x9 @vitest/mocker (npm) Fixed in 4.1.11 Advisory →
- Fix · GHSA-82fw-gwwq-j7x9 vitest (npm) Fixed in 4.1.11 Advisory →
- Fix · GHSA-82fw-gwwq-j7x9 vitest (npm) Fixed in 5.0.0-rc.2 Advisory →
- Fix · GHSA-82fw-gwwq-j7x9 @vitest/mocker (npm) Fixed in 5.0.0-rc.2 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat AMQ Broker 7 | Affected | No fix yet: Fix deferred |
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat Build of Keycloak | Affected | No fix yet: Fix deferred |
| Red Hat Build of Podman Desktop | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 10 | Affected | No fix yet: Fix deferred |
| Red Hat JBoss Enterprise Application Platform 8 | Affected | No fix yet: Fix deferred |
| Red Hat JBoss Enterprise Application Platform Expansion Pack | Affected | No fix yet: Fix deferred |
| Red Hat Trusted Artifact Signer | Affected | No fix planned: Out of support scope |
Not affected: 1 product
- Red Hat Hardened Images
Timeline
- 2026-10-02 Threatist record created from CVE-2026-84373
- 2026-10-03 Alias added: GHSA-82fw-gwwq-j7x9
References
Other 9
- https://github.com/vitest-dev/vitest/security/advisories/GHSA-82fw-gwwq-j7x9
- https://github.com/vitest-dev/vitest/pull/10972
- https://github.com/vitest-dev/vitest/pull/10974
- https://github.com/vitest-dev/vitest/commit/51edf2b072902aec6d30c90ebaafd8f121c6f9d8
- https://github.com/vitest-dev/vitest/commit/8ff9b9a9efca7c6cfd5243569440de8d7a33aec4
- https://github.com/vitest-dev/vitest/commit/fe5a11d3ceac5ec10d6d7d21a46d4caca132c48f
- https://github.com/vitest-dev/vitest/releases/tag/v4.1.11
- https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.2
- https://github.com/vitest-dev/vitest
More vitest-dev vulnerabilities
- TI-2026-38677 Vitest: Exposed Browser Mode API Can Proxy CDP and Overwrite Config Files, Leading to RCE CVSS 3.1CRITICAL 9.8
- TI-2026-34992 Vitest: Arbitrary file can be read and executed when Vitest UI server is listening CVSS 3.1CRITICAL 9.8
- TI-2026-34991 Vitest browser mode serves unsanitized otelCarrier query parameter as inline script CVSS 3.1CRITICAL 9.6
- TI-2025-18644 Remote Code Execution when accessing a malicious website while Vitest API server is listening CVSS 3.1CRITICAL 9.7
- TI-2025-18643 Browser mode serves arbitrary files in vitest CVSS 3.1HIGH 7.5
- TI-2026-76917 Backslash traversal in Vitest mocker exposes files on Windows CVSS 3.1MEDIUM 5.9
Sources
- CVE-2026-84373 · CVE Program
- CVE-2026-84373 · NVD
- FIRST EPSS
- GHSA-82fw-gwwq-j7x9 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-84373 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences