CVE-2026-112949: vitest-dev vitest Code Injection
Vulnerability summary
CVE-2026-112949 is a medium (CVSS 4.7) Code Injection vulnerability in vitest-dev vitest. EPSS estimates a 0.24% chance of exploitation in the next 30 days, higher than 14.4% of scored vulnerabilities.
Timeline
- 20-10-2026PublishedVulnerability first disclosed.
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.
CVSS metrics
3 scores · 3 sources · 1 version- NVDNIST4.7MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
- OSV · NpmEcosystem advisory · calculated4.7MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
EPSS trend
Probability
0.24%
Chance of exploitation in the next 30 days
Percentile
14%
Versus all other CVEs
30-day change
Change unavailable
Change unavailable
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-94Improper Control of Generation of Code ('Code Injection')The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
- CWE-116Improper Encoding or Escaping of OutputThe product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
- CWE-306Missing Authentication for Critical FunctionThe product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.
Affected systems
@vitest2 products
- mocker≥ 2.1.0-beta.7, < 4.1.12 | ≥ 5.0.0-beta.1, < 5.0.3
- mocker≥ 2.1.0-beta.7, < 4.1.12 | ≥ 5.0.0, < 5.0.3
Vitest-dev1 product
- vitest≥ 2.1.0-beta.7, < 4.1.12 | ≥ 5.0.0, < 5.0.3
2 vendors · 3 products
References
7 links- github.com/vitest-dev/vitestPACKAGE