CVE-2026-112949

Vitest: Code injection via unauthenticated manual mock registration

Published Oct 20, 2026 CVSS 3.1 · 4.7 Medium EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-qxg6-89mg-rqv8 Vitest: Code injection via unauthenticated manual mock registration
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Vitest.dev
Vitest.dev mocker
Vitest.dev vitest
Vendors & Products Vitest.dev
Vitest.dev mocker
Vitest.dev vitest
Type Values Removed Values Added
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.
Title Vitest: Code injection via unauthenticated manual mock registration
Weaknesses CWE-116
CWE-306
CWE-94
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N'}

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 23, 2026, 1:42 AM
Reserved
Oct 19, 2026, 9:30 PM
Status
Awaiting Analysis
Published
Oct 20, 2026, 4:17 PM
Modified
Oct 23, 2026, 2:16 AM
Severity
Moderate
Public date
Oct 20, 2026, 3:19 PM