CVE-2026-112950: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in vitest-dev vitest
Description
CVE-2026-112950 is a path traversal vulnerability in the Vitest testing framework for JavaScript and TypeScript. It affects versions from 4.1.11 up to but not including 4.1.12, and from 5.0.0-rc.2 up to but not including 5.0.3. On Windows, the issue arises because backslash characters in paths are interpreted inconsistently, allowing a client connected to the Vite dev server to read files outside the intended allowed directory. This vulnerability is fixed in versions 4.1.12 and 5.0.3.
CVSS v3.1
Score 5.9medium
Affected software
vitest-dev
vitest
@vitest
mocker
pkg:npm/vitest-dev/vitestRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Vitest versions >=4.1.11 <4.1.12 and >=5.0.0-rc.2 <5.0.3 contain a path traversal vulnerability (CWE-22) due to improper handling of backslash characters in filesystem paths on Windows. The isFileLoadingAllowed function and filesystem read operations interpret backslashes differently, enabling a client able to reach the Vite dev server to register a redirect mock with backslash traversal sequences. This causes POSIX path joining to preserve Windows backslash traversal, which the filesystem read then interprets as path separators, allowing unauthorized file reads outside the configured server.fs.allow directory. The vulnerability is resolved in versions 4.1.12 and 5.0.3.
Potential Impact
An unauthenticated remote attacker who can access the Vite development server on Windows can exploit this vulnerability to read arbitrary files accessible to the Vitest process outside the intended restricted directory. This leads to confidentiality breaches but does not affect integrity or availability. The CVSS 3.1 score is 5.9 (medium severity) with network attack vector, high attack complexity, no privileges required, no user interaction, and impact limited to confidentiality.
Mitigation Recommendations
Upgrade Vitest to version 4.1.12 or later, or 5.0.3 or later, where this path traversal vulnerability is fixed. No other mitigation is indicated by the vendor advisory. Patch status is confirmed fixed in these versions.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-19T21:30:47.246Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6ad78d8b2cdf04f6563d7711
Added to database: 10/20/2026, 15:49:31 UTC
Last enriched: 10/20/2026, 16:03:47 UTC
Last updated: 10/20/2026, 19:06:08 UTC
Views: 8
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.