Skip to content
PatchBriefing

Search PatchBriefing

Type at least two characters. Results update as you type.

Search CVEs, products, packages and article titles.

Nothing found. Identifiers such as CVE and GHSA can be searched in both languages.

Subscribe

Medium · 6.5 Node.js & npm GHSA-p458-7748-mcp3 CVE-2026-112948 GHSA-qxg6-89mg-rqv8 CVE-2026-112949

Three Vitest Vulnerabilities Allow Sensitive File Exposure and Code Injection via Dev Servers

Three vulnerabilities in the Vitest testing framework's development server components allow unauthorized actors to read sensitive files, including .env values and an API token, and in one case execute attacker-controlled JavaScript on the developer's browser origin. Fixes are available.

By PatchBriefing ·

Produced automatically from official sources with the help of AI. How we work →

AI summary

Three vulnerabilities have been disclosed in Vitest, a Vite-native testing framework widely used in JavaScript and TypeScript projects. The issues affect development server components including @vitest/ui, @vitest/browser, @vitest/mocker, and vite-plus. Each vulnerability allows an attacker who can reach an affected development server to access sensitive information or, in one case, execute arbitrary JavaScript in the developer's browser. Fixes are available for all three issues.

Three separate vulnerabilities disclosed

Three distinct CVEs were published for Vitest-related packages on the same day. CVE-2026-112948 concerns misapplication of the server.fs.deny filesystem restriction, allowing denied project files or a fallback API token to be read, and in Browser Mode configurations can expose .env values to a malicious website (source_item_ids 116572, 120236). CVE-2026-112949 describes a code injection flaw in the mocker component, where an attacker-controlled URL inserted into generated module source can execute JavaScript on the development-server origin when loaded by a developer's browser (source_item_ids 116573, 120235). CVE-2026-112950 describes a Windows-specific path traversal in the mocker's interceptor plugin, caused by inconsistent backslash handling between path validation and the actual filesystem read, allowing files outside the configured server.fs.allow list to be read (source_item_ids 116574, 120234, 120256).

Root causes

CVE-2026-112948 arises because project-level development servers replace Vite's default deny rules, and the root server adds a secret-token exclusion only after Vite has already compiled its filesystem matcher, so the restriction does not apply consistently across affected UI, Browser Mode, and API servers (source_item_id 120236). CVE-2026-112949 is caused by createManualModuleSource inserting an attacker-supplied mock URL into generated module source without escaping, enabling code execution when an unauthenticated WebSocket client registers a manual mock reachable via interceptorPlugin (source_item_id 120235). CVE-2026-112950 stems from isFileLoadingAllowed and the subsequent filesystem read interpreting backslashes differently on Windows: POSIX-style path joining preserves a Windows backslash sequence that the filesystem read later treats as a path separator, letting a crafted redirect mock traverse outside the allowed directory (source_item_ids 120234, 120256).

Why this matters

All three issues affect components used during local development, which often run with elevated trust assumptions and access to secrets such as .env files, private keys, or API tokens. CVE-2026-112948 can expose sensitive project files and a fallback API token, and in Browser Mode setups can leak .env values to a malicious website reachable from the developer's browser (source_item_id 120236). CVE-2026-112949 allows arbitrary JavaScript execution on the development-server origin, which could be used to pivot against other locally accessible resources (source_item_id 120235). CVE-2026-112950 bypasses a filesystem access restriction on Windows, allowing reads outside the intended directory boundary (source_item_ids 120234, 120256). None of the three vulnerabilities are reported as actively exploited, and no public exploit code is referenced in the available facts.

Who is affected

Developers and teams running affected versions of @vitest/ui, @vitest/browser, @vitest/mocker, or vite-plus with their development server, UI, Browser Mode, or API server reachable by an untrusted client are affected. CVE-2026-112949 specifically requires an unauthenticated non-browser WebSocket client able to reach a development server using interceptorPlugin. CVE-2026-112950 is specific to Windows environments.

Affected versions

CVE-2026-112948 affects @vitest/ui and @vitest/browser from 5.0.0-beta.6 up to but not including 5.0.5, and vite-plus from 1.0.0-rc.0 up to but not including 1.3.0 (source_item_id 120236). CVE-2026-112949 affects @vitest/mocker from 5.0.0-beta.1 up to but not including 5.0.3; the advisory also references an earlier affected range starting at 2.1.0-beta.7 fixed in 4.1.12 (source_item_ids 120235). CVE-2026-112950 affects @vitest/mocker from 5.0.0-rc.2 up to but not including 5.0.3, with an additional narrower range from 4.1.11 up to but not including 4.1.12 noted in the claims (source_item_ids 120234, 120256). Note: the fact package contains slightly differing affected-range statements for @vitest/mocker between the package list and the individual claims; readers should consult the original advisories for exact boundary details.

Fixes available

CVE-2026-112948 is fixed in @vitest/ui and @vitest/browser version 5.0.5, and in vite-plus version 1.3.0 (source_item_id 120236). CVE-2026-112949 is fixed in @vitest/mocker versions 4.1.12 and 5.0.3 (source_item_id 120235). CVE-2026-112950 is fixed in @vitest/mocker versions 4.1.12 and 5.0.3 (source_item_ids 120234, 120256).

Recommended action

Update @vitest/ui and @vitest/browser to version 5.0.5 or later, update vite-plus to version 1.3.0 or later, and update @vitest/mocker to version 4.1.12 or 5.0.3 (or later) depending on your release track. Review exposure of development servers, UI, Browser Mode, and API endpoints to untrusted networks, and avoid storing long-lived secrets accessible to local development tooling where possible.

PatchBriefing score

6.5 / 10 · Medium

Official CVSS: 6.5

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

EPSS 0.0046 (32 percentile)

Why this score

The PatchBriefing score equals the official CVSS score; when this article covers several vulnerabilities, the highest one. Signals such as known exploitation and EPSS are listed separately and do not change the score.

Affected versions

@vitest/ui >= 5.0.0-beta.6, < 5.0.5
vulnerable
≥ 5.0.5
patched
@vitest/browser >= 5.0.0-beta.6, < 5.0.5
vulnerable
≥ 5.0.5
patched
vite-plus >= 1.0.0-rc.0, < 1.3.0
vulnerable
≥ 1.3.0
patched
@vitest/mocker >= 5.0.0-beta.1, < 5.0.3
vulnerable
≥ 4.1.12
patched
≥ 5.0.3
patched
@vitest/mocker >= 5.0.0-rc.2, < 5.0.3
vulnerable
@vitest/mocker ≥ 5.0.0-rc.2 < 5.0.3
vulnerable
≥ 4.1.12
patched
≥ 5.0.3
patched

Reported fixes

CVE-2026-112948 is fixed in @vitest/ui and @vitest/browser version 5.0.5, and in vite-plus version 1.3.0 (source_item_id 120236). CVE-2026-112949 is fixed in @vitest/mocker versions 4.1.12 and 5.0.3 (source_item_id 120235). CVE-2026-112950 is fixed in @vitest/mocker versions 4.1.12 and 5.0.3 (source_item_ids 120234, 120256).

How this was built

7 source records were collected, matched and used to prepare the report above.

  • NVD (NIST) database
  • NVD (NIST) database
  • NVD (NIST) database
  • GitHub Advisory Database database
  • GitHub Advisory Database database
  • GitHub Advisory Database database
Unified report
Three Vitest Vulnerabilities Allow Sensitive File Exposure and Code Injection via Dev Servers
1 article · 7 sources cited
Revision history
  1. Published
  2. Generated
The Morning Brief

Relevant changes for the stacks you follow.

Choose your stacks, topics and optional WordPress plugins. At 07:00 CET, matching advisories and releases from the reporting period are grouped into one email.

✓ Choose stacks and topics✓ Change preferences anytime✓ One grouped email