Skip to content
Heist/ feed
Medium

Vitest: Code injection via unauthenticated manual mock registration

Type: advisorySource: Official CVE List1 source 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.

Announced Source revision 1
Original source ↗

CVE-2026-112949

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2026-112949

vitest

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

mocker

Source reference: /containers/cna/affected/1/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "vendor": "vitest-dev",
    "product": "vitest",
    "versions": [
      {
        "status": "affected",
        "version": ">= 2.1.0-beta.7, < 4.1.12"
      },
      {
        "status": "affected",
        "version": ">= 5.0.0, < 5.0.3"
      }
    ]
  },
  {
    "vendor": "@vitest",
    "product": "mocker",
    "versions": [
      {
        "status": "affected",
        "version": ">= 2.1.0-beta.7, < 4.1.12"
      },
      {
        "status": "affected",
        "version": ">= 5.0.0, < 5.0.3"
      }
    ]
  }
]
Related CVEs
CVE-2026-112949

Source reference: /cveMetadata/cveId

Publisher severity

medium

Source reference: /containers/cna/metrics

Event
#52537 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement