CVE-2026-112950: @vitest/mocker Windows Backslash Traversal Vulnerability

@vitest/mocker Updated 22 Oct 2026

Summary

21/10/2026
Yes i
Moderate
5.9

CVE-2026-112950: Vitest: Windows backslash traversal bypasses the @vitest/mocker redirect allowlist fix. Affects @vitest/mocker across 2 version ranges.

>= 4.1.11, < 4.1.12 >= 5.0.0-rc.2, < 5.0.3

Fixed in 4.1.12 or 5.0.3, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Vitest is a testing framework designed for modern JavaScript applications, providing a fast and efficient way to run tests. The @vitest/mocker package allows developers to create mock implementations for testing purposes. However, a vulnerability exists that allows attackers to bypass security measures on Windows systems, potentially leading to unauthorized file access.

Vulnerability Detail

The vulnerability arises from a flaw in the path traversal fix implemented in the @vitest/mocker package. Specifically, the code incorrectly handles backslashes in redirect URLs on Windows systems. When an attacker crafts a URL with a backslash, such as 'C:/project/root/..\secret.txt', the path traversal check fails to reject it, allowing access to files outside the intended directory. This can lead to unauthorized reading of sensitive files, posing a significant security risk.

How To Fix

Latest published version: 5.0.5 as of 22 Oct 2026

npm install @vitest/mocker@5.0.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 4.1.11, < 4.1.12 4.1.12
    npm install @vitest/mocker@4.1.12
  • >= 5.0.0-rc.2, < 5.0.3 5.0.3
    npm install @vitest/mocker@5.0.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, ensure that your application does not expose the @vitest/mocker plugin to untrusted clients, especially on Windows systems. Additionally, you can manually validate and sanitize input paths to prevent unauthorized access.

Conclusion

The CVE-2026-112950 vulnerability in the @vitest/mocker package poses a significant risk for applications running on Windows systems due to improper handling of backslashes in URL paths. Updating to the patched version is crucial to mitigate this risk and protect sensitive files from unauthorized access.

See every vulnerability recorded for @vitest/mocker →

Share this vulnerability

FAQ

CVE-2026-112950 is a vulnerability in the @vitest/mocker package that allows path traversal attacks on Windows systems, enabling unauthorized file access.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your package-lock.json for vulnerabilities.

Affected versions include @vitest/mocker 4.1.11 and versions from 5.0.0-rc.2 to 5.0.2. The vulnerability has been fixed in version 5.0.3 and 4.1.12.

If you cannot update immediately, consider restricting access to the @vitest/mocker plugin and validating input paths to mitigate the risk of exploitation.

The CVSS score of this vulnerability is 5.9, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for @vitest/mocker.

How To Fix

Latest published version: 5.0.5 as of 22 Oct 2026

npm install @vitest/mocker@5.0.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 4.1.11, < 4.1.12 4.1.12
    npm install @vitest/mocker@4.1.12
  • >= 5.0.0-rc.2, < 5.0.3 5.0.3
    npm install @vitest/mocker@5.0.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback