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.

Project Subscriptions

Vendors Products
Vitest.dev Subscribe
Advisories
Source ID Title
Github GHSA Github GHSA GHSA-qxg6-89mg-rqv8 Vitest: Code injection via unauthenticated manual mock registration
Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

Wed, 21 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-79
References
Metrics threat_severity

None

threat_severity

Moderate


Tue, 20 Oct 2026 20:30:00 +0000

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

Tue, 20 Oct 2026 15:30:00 +0000

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'}


Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-20T15:19:03.799Z

Reserved: 2026-10-19T21:30:47.245Z

Link: CVE-2026-112949

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-10-20T16:17:05.660

Modified: 2026-10-20T19:56:45.543

Link: CVE-2026-112949

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-20T15:19:03Z

Links: CVE-2026-112949 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T20:15:06Z