CVE-2026-112949

Vitest: Code injection via unauthenticated manual mock registration

  • Medium 4.7

Description

Vitest is a Vite-native testing framework for JavaScript and TypeScript projects. From 2.1.0-beta.7 until 4.1.12 and 5.0.3, an unauthenticated non-browser WebSocket client that can reach a development server using interceptorPlugin can register a manual mock whose attacker-controlled url createManualModuleSource inserts unescaped into generated module source. When the developer browser loads the affected module, attacker-controlled JavaScript executes on the development-server origin. This issue is fixed in versions 4.1.12 and 5.0.3.

Key facts

Published
20 Oct 2026
Last changed
23 Oct 2026
Assigned by
GitHub_M
EPSS
0.336% likely to be exploited in the next 30 days, higher than 27.464% of CVEs (scores for 18 Nov 2026)
SSVC (CISA)
Exploitation: poc; Automatable: no; Technical impact: partial

Severity scores

Each score is shown as its source gave it. They are not averaged or merged.

  • 4.7CVSS 3.1, Mediumfrom the CNA (GitHub_M)CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

Historical context and remediation

This reference retains the original CVE publication date. A recent record update does not mean a new attack occurred.

No separately sourced impact summary is available on this page yet. Consult the description, version data and dated exploitation evidence.

No explicit remediation statement is available on this page yet. Consult the original record and vendor references before choosing a fix.

Version statuses below come from the CNA. An “unaffected” version is not necessarily a currently supported release or proof of a patch date. EPSS is a dated risk estimate, not a count of historical attacks.

Read the original CVE record.

Affected products

VendorProductVersions
vitest-devvitest
  • >= 2.1.0-beta.7, < 4.1.12 (affected)
  • >= 5.0.0, < 5.0.3 (affected)
@vitestmocker
  • >= 2.1.0-beta.7, < 4.1.12 (affected)
  • >= 5.0.0, < 5.0.3 (affected)

Timeline

  1. 20 Oct 2026 Published

Weakness

References