Skip to main content
VulnerabilityPublished Updated

CVE-2026-112949: vitest · Code Injection

Affects vitestSource CVE Database V5

0
Compare

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

CVSS 3.1 base score
4.7Medium
How severe the flaw is on the 0–10 CVSS scale.

Thin evidence

One scorer or none
CVSS scores by source
CNA (GitHub_M)CVSS 3.14.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:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 20 Oct 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
vitest-devvitestAffected
  • >=5.0.0 <5.0.3
Fixed in
  • 5.0.3
vitest-devvitestAffected
  • >=2.1.0-beta.7 <4.1.12
Fixed in
  • 4.1.12
@vitestmockerAffected
  • >=5.0.0 <5.0.3
Fixed in
  • 5.0.3
@vitestmockerAffected
  • >=2.1.0-beta.7 <4.1.12
Fixed in
  • 4.1.12
npmvitest-dev/vitestpkg:npm/vitest-dev/vitestOther threatsAffected
  • >=2.1.0-beta.7 <4.1.12
  • >=5.0.0 <5.0.3
Fixed in
  • 4.1.12
  • 5.0.3

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

Community reviews

Loading reviews…