CVE-2026-84373
Received Received - Intake

Path Traversal in Vitest Testing Framework

Vulnerability report for CVE-2026-84373, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-09-01

Last updated on: 2026-09-01

Assigner: GitHub, Inc.

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-09-01
Last Modified
2026-09-01
Generated
2026-09-02
AI Q&A
2026-09-02
EPSS Evaluated
N/A
NVD

Affected Vendors & Products

Showing 3 associated CPEs
Vendor Product Version / Range
vitest vitest From 2.1.0 (inc) to 4.1.11 (inc)
vitest vitest 4.1.11
vitest vitest 5.0.0-rc.2

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability in Vitest allows a remote attacker to access local files on a developer's machine by exploiting unauthenticated WebSocket connections. The issue occurs because the mockerPlugin and interceptorPlugin do not validate file paths during redirects, enabling directory traversal attacks that bypass server-side restrictions.

Impact Analysis

If you use affected Vitest versions, an attacker could read sensitive files on your system by sending crafted requests to the exposed development server. This could expose source code, configuration files, or other sensitive data accessible by the server process.

Compliance Impact

This vulnerability could lead to unauthorized data exposure, violating GDPR's data protection principles or HIPAA's confidentiality requirements. Organizations may face compliance violations if sensitive data is leaked due to this issue.

Mitigation Strategies

Upgrade Vitest to version 4.1.11 or later, or 5.0.0-rc.2 or later. Avoid exposing development servers to untrusted networks. Review server configurations to ensure file access restrictions are properly enforced.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-84373. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart