Skip to main content

CVE-2026-112950: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in vitest-dev vitest

0
Medium
VulnerabilityCVE-2026-112950cvecve-2026-112950cwe-22
Published: 10/20/2026 (10/20/2026, 15:21:32 UTC)
Source: CVE Database V5
Vendor/Project: vitest-dev
Product: 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

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

Affected software

vitest-dev

vitest

Affected versions
>=4.1.11 <4.1.12>=5.0.0-rc.2 <5.0.3

@vitest

mocker

Affected versions
>=4.1.11 <4.1.12>=5.0.0-rc.2 <5.0.3
vitest-dev/vitest
pkg:npm/vitest-dev/vitest
Affected versions
>=4.1.11 <4.1.12>=5.0.0-rc.2 <5.0.3

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/20/2026, 16:03:47 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses