CVE-2026-112949
Medium · 4.7CVSS
4.7
EPSS
0.3%
Published
Oct 20, 2026
CISA due date
—
Cloudanix analysis
A problem in a popular JavaScript testing tool could let someone run harmful code inside a developer's browser while the developer is testing their own project.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Data Exposure
- Component
- Application
- Class
- XSS
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
An unauthenticated WebSocket client can register a manual mock with an attacker-controlled URL that is inserted unescaped into generated module source, resulting in cross-site scripting execution within the development server origin when the module is loaded in the browser.
Why it matters to the business
Developers using affected versions for JavaScript or TypeScript projects face risk of code execution in their testing environment, potentially exposing source code, credentials, or local resources during routine development work six days after disclosure with a modest rise in exploitation probability.
How an attack unfolds
An attacker reaches the development server WebSocket endpoint and uses interceptorPlugin to register a manual mock containing a malicious URL; when a developer browser loads the affected module the unescaped payload executes JavaScript on the server origin.
How to fix it
Upgrade Vitest to version 4.1.12 or 5.0.3. If immediate upgrade is not possible, restrict WebSocket access to trusted clients and avoid exposing development servers to untrusted networks.
How to confirm the fix worked
Verify the installed Vitest version is 4.1.12 or newer; test that manual mocks containing URLs with special characters are properly escaped in generated module source.
Typical attack path
- Locate an exposed Vitest development server WebSocket endpoint
- Connect as a non-browser client and invoke interceptorPlugin
- Register a manual mock whose URL contains attacker-controlled JavaScript
- Wait for a developer to load the mocked module in the browser
- Execute payload on the development server origin
How to detect it
Review development server logs for unexpected WebSocket connections from non-browser clients and inspect manual mock registration events for URLs containing script tags or encoded payloads.
What your security team should do
- Prioritize upgrade to 4.1.12 or 5.0.3 within the next sprint
- Audit exposed development servers and apply network controls to limit WebSocket access
- Monitor EPSS trend and re-evaluate risk if exploitation maturity increases
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-63378 TAKO AI Agent for Okta is a local-first AI agent that helps Okta administrators query… CWE-94
- CVE-2026-63346 Refitter is a tool for generating a C# REST API client using the Refit library. CWE-94
- CVE-2026-63345 Refitter is a tool for generating a C# REST API client using the Refit library. CWE-94
- CVE-2026-63344 Refitter is a tool for generating a C# REST API client using the Refit library. CWE-94
- CVE-2026-62853 ThingLinks is an enterprise IoT platform. CWE-94
- CVE-2026-62284 OSAC operator is a Kubernetes operator. CWE-94
- CVE-2026-116852 Author Remote Code Execution (RCE) in Widget Options <= 4.2.5 versions. CWE-94
- CVE-2026-118635 The The GeoDirectory – WP Business Directory Plugin and Classified Listings Directory… CWE-94