# CVE-2026-112949: Vitest code injection in interceptorPlugin manual mocks

Source: https://junglewise.ai/threats/cve-2026-112949-vitest-is-a-vite-native-testing-framework-for-javascript-and  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-20. Updated: 2026-10-20  
License: CC BY 4.0 with a link back

CVE-2026-112949 · Severity: medium · CVSS 4.7 · Published 2026-10-20

Vitest is a testing framework for JavaScript and TypeScript development. An attacker with network access to a development server can inject malicious JavaScript that executes in the browser when developers run tests, potentially allowing theft of sensitive code or credentials. This affects development environments only, not production applications.

Technologies: [@vitest/mocker (npm)](https://junglewise.ai/threats/technologies/vitest-mocker), [Vitest](https://junglewise.ai/threats/technologies/vitest). Vendors: [npm](https://junglewise.ai/threats/vendors/npm), [Vitest](https://junglewise.ai/threats/vendors/vitest).

## Quick answers

**Is CVE-2026-112949 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-112949 being exploited in the wild.

**How severe is CVE-2026-112949?** Medium severity, with a CVSS score of 4.7, published 20 October 2026.

**Which products and versions are affected?** @vitest/mocker (npm) >= 2.1.0-beta.7, < 4.1.12, SEMVER:introduced=2.1.0-beta.7,fixed=4.1.12; Vitest 2.1.0-beta.7 to 4.1.11; 5.0.0 to 5.0.2.

**Is there a fix for CVE-2026-112949?** Yes. @vitest/mocker (npm): upgrade to 4.1.12 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-112949 attacked?** It is attacked over the network or from the adjacent network, in a software library.

**Am I affected by CVE-2026-112949?** Check whether you run @vitest/mocker (npm) or Vitest at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @vitest/mocker (npm): upgrade to 4.1.12 or later

  ```sh
  npm install @vitest/mocker@4.1.12
  ```


## Technical details

An unauthenticated WebSocket client can reach a development server's interceptorPlugin and register a manual mock with an attacker-controlled URL. The createManualModuleSource function inserts this URL unescaped into generated module source code. When a developer's browser loads the affected module, the attacker's JavaScript executes with development-server origin privileges. The vulnerability requires network access to the dev server and user interaction (developer loading the page).

## Affected products

- Vitest Vitest 2.1.0-beta.7 to 4.1.11; 5.0.0 to 5.0.2

## Identifiers

- CVE-2026-112949
- GHSA-qxg6-89mg-rqv8

## Timeline

- 2026-10-20: disclosed

## References

- [https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35](https://github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35)
- [https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473](https://github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473)

## Related threats

- [Vitest path traversal via backslash interpretation on Windows](https://junglewise.ai/threats/cve-2026-112950-vitest-is-a-vite-native-testing-framework-for-javascript-and)
- [Vitest filesystem deny misapplication in dev servers](https://junglewise.ai/threats/cve-2026-112948-vitest-is-a-testing-framework-powered-by-vite-from-5-0-0-beta-6)
- [Vitest @vitest/mocker path traversal in redirect mock](https://junglewise.ai/threats/cve-2026-84373-vitest-vitest-mocker-path-traversal-in-redirect-mock)
