Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @vitest/mocker
  4. ›
  5. CVE-2026-84373

CVE-2026-84373: Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock

September 8, 2026

@vitest/mocker registers a redirect mock’s target path without validating it against the dev server’s file-serving allowlist. An attacker who can reach the dev server’s WebSocket can register a redirect mock pointing outside the project root; when the mocked module is requested, the plugin’s load hook returns readFile(<attacker path>) as the module source, disclosing local files.

This is exploitable without authentication only through the public mockerPlugin / standalone interceptorPlugin exports (used by third-party dev servers), which register the handler on Vite’s unauthenticated HMR socket. Vitest’s own browser mode registers mocks over a token-authenticated RPC and is not remotely reachable by default (see Scope).

References

  • github.com/advisories/GHSA-82fw-gwwq-j7x9
  • github.com/vitest-dev/vitest/commit/51edf2b072902aec6d30c90ebaafd8f121c6f9d8
  • github.com/vitest-dev/vitest/commit/8ff9b9a9efca7c6cfd5243569440de8d7a33aec4
  • github.com/vitest-dev/vitest/commit/fe5a11d3ceac5ec10d6d7d21a46d4caca132c48f
  • github.com/vitest-dev/vitest/pull/10972
  • github.com/vitest-dev/vitest/pull/10974
  • github.com/vitest-dev/vitest/releases/tag/v4.1.11
  • github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.2
  • github.com/vitest-dev/vitest/security/advisories/GHSA-82fw-gwwq-j7x9
  • nvd.nist.gov/vuln/detail/CVE-2026-84373

Code Behaviors & Features

Detect and mitigate CVE-2026-84373 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.1.0 before 4.1.11, all versions starting from 5.0.0-beta.1 before 5.0.0-rc.2

Fixed versions

  • 4.1.11
  • 5.0.0-rc.2

Solution

Upgrade to versions 4.1.11, 5.0.0-rc.2 or above.

Impact 5.9 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

npm/@vitest/mocker/CVE-2026-84373.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 22 Sep 2026 12:20:02 +0000.