Description
Vitest is a Vite-native testing framework for JavaScript and TypeScript projects. From 4.1.11 until 4.1.12 and 5.0.3, isFileLoadingAllowed and the filesystem read interpret backslashes differently on Windows in packages/mocker/src/node/interceptorPlugin.ts. When a client can reach the Vite dev server on Windows and register a redirect mock containing backslash traversal, POSIX joining preserves a Windows backslash traversal that the later filesystem read interprets as a path separator, so the client can read a file outside server.fs.allow that the Vitest process can access. This issue is fixed in versions 4.1.12 and 5.0.3.
Published: 2026-10-20
Score: 5.9 Medium
EPSS: n/a
KEV: No
Impact: Server-side file disclosure via backslash traversal on Windows
Action: Immediate patch
AI Analysis

Impact

When the Vitest dev server runs on Windows, a client can register a redirect mock that contains a backslash traversal. Because the server’s path handling treats backslashes differently, the POSIX join preserves the backslash, and the subsequent filesystem read interprets it as a path separator. This allows the client to read any file outside the server.fs.allow list that the Vitest process can access, effectively leaking arbitrary files. The vulnerability is a path traversal flaw (CWE‑22).

Affected Systems

The affected products are vitest‑dev:vitest and @vitest:mocker. Vulnerable versions include all releases before 4.1.12 and before 5.0.3. The issue was fixed in Vitest 4.1.12 and Vitest 5.0.3, which corrected the path handling logic for Windows backslashes.

Risk and Exploitability

The CVSS score of 5.9 indicates moderate severity. EPSS data is unavailable and the vulnerability is not listed in CISA KEV, suggesting limited known exploitation activity. The attack requires a client to reach the Vite dev server on a Windows machine and provide a malicious redirect mock, typically in a developer or CI environment. If an attacker can control such a client, they can read confidential files from the server filesystem, jeopardizing confidentiality.

Generated by OpenCVE AI on October 20, 2026 at 17:20 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Vitest to version 4.1.12 or later, or 5.0.3 or later.
  • Restrict network access to the Vite dev server to trusted users or segments to prevent unauthorized clients from injecting malicious mocks.
  • Validate or sanitize any redirect mocks so that backslashes are removed or replaced with forward slashes before they are processed.

Generated by OpenCVE AI on October 20, 2026 at 17:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 20 Oct 2026 15:45:00 +0000

Type Values Removed Values Added
Description Vitest is a Vite-native testing framework for JavaScript and TypeScript projects. From 4.1.11 until 4.1.12 and 5.0.3, isFileLoadingAllowed and the filesystem read interpret backslashes differently on Windows in packages/mocker/src/node/interceptorPlugin.ts. When a client can reach the Vite dev server on Windows and register a redirect mock containing backslash traversal, POSIX joining preserves a Windows backslash traversal that the later filesystem read interprets as a path separator, so the client can read a file outside server.fs.allow that the Vitest process can access. This issue is fixed in versions 4.1.12 and 5.0.3.
Title Vitest: Windows backslash traversal bypasses the @vitest/mocker redirect allowlist fix
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-20T15:21:32.396Z

Reserved: 2026-10-19T21:30:47.246Z

Link: CVE-2026-112950

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-20T16:17:05.807

Modified: 2026-10-20T16:17:05.807

Link: CVE-2026-112950

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T17:30:13Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')