CVE-2026-112949: vitest · Code Injection
Affects vitestSource CVE Database V5
Not known to be exploited · CVSS 4.7 Medium : upgrade to 5.0.3 or 4.1.12 when convenient.
Data as of 29 Oct 2026, 19:15 UTC
Thin evidence
One scorer or none| CNA (GitHub_M) | CVSS 3.1 | 4.7 |
|---|
- EPSS
- 0.3% chance of exploitation in 30 days – higher than 26% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 5.0.3, 4.1.12
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:NExploitation evidence
Disclosed: evidence found.
CVE published 20 Oct 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.
What to do
Upgrade vitest and mocker and vitest-dev/vitest to 5.0.3 or 4.1.12.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| vitest-devvitest | Affected
| Fixed in
|
| vitest-devvitest | Affected
| Fixed in
|
| @vitestmocker | Affected
| Fixed in
|
| @vitestmocker | Affected
| Fixed in
|
npmvitest-dev/vitestpkg:npm/vitest-dev/vitestOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade vitest to version 4.1.12 or later, or 5.0.3 or later, where this vulnerability is fixed. No other mitigation is indicated by the vendor advisory.
Description
Vitest, a Vite-native testing framework for JavaScript and TypeScript, contains a code injection vulnerability in versions from 2.1.0-beta.7 up to but not including 4.1.12 and from 5.0.0 up to but not including 5.0.3. An unauthenticated non-browser WebSocket client can exploit this by registering a manual mock with an attacker-controlled URL that is inserted unescaped into generated module source. This leads to execution of attacker-controlled JavaScript on the development server origin when the developer's browser loads the module. The issue is fixed in versions 4.1.12 and 5.0.3.
References
- github.com/vitest-dev/vitest/security/advisories/GHSA-qxg6-89mg-rqv8 (opens in a new tab)
- github.com/vitest-dev/vitest/commit/15cc006aa9f8683dc5f7e895d011fa7dc751ce35 (opens in a new tab)
- github.com/vitest-dev/vitest/commit/b825313243dc55757e8d7c0f9e7a792135e13473 (opens in a new tab)
- github.com/vitest-dev/vitest/releases/tag/v4.1.12 (opens in a new tab)
- github.com/vitest-dev/vitest/releases/tag/v5.0.3 (opens in a new tab)