Vulnerability · Published Jul 14, 2026 · Assigned by GitHub_M

CVE-2026-47428Vitest browser mode serves unsanitized otelCarrier query parameter as inline script

Critical 9.6

In plain English

A critical-severity cross-site scripting in vitest from vitest-dev. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 48% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)9.6Critical
Exploit odds (30 days)0.6%top 52.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

Vitest is a testing framework powered by Vite. From 4.0.17 until 4.1.6 and 5.0.0-beta.3, Vitest Browser Mode served /__vitest_test__/ with the otelCarrier query parameter inserted directly into an inline module script, allowing a crafted browser-runner URL to execute arbitrary JavaScript in the Vitest server origin and recover VITEST_API_TOKEN for authenticated API calls. This issue is fixed in versions 4.1.6 and 5.0.0-beta.3.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
npm@vitest/browser4.1.6GHSA-2h32-95rg-cppp
npm@vitest/browser5.0.0-beta.3GHSA-2h32-95rg-cppp

Affected products (as reported)

VendorProductVersions
vitest-dev vitest >= 4.0.17, < 4.1.6>= 5.0.0-beta.0, < 5.0.0-beta.3

Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

References