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.
Published: 2026-07-14
Score: 9.6 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Vitest, a JavaScript testing framework built on Vite, served its /__vitest_test__/ endpoint in Browser Mode. From version 4.0.17 until 4.1.6 and 5.0.0‑beta.3, the otelCarrier query parameter was inserted directly into an inline module script without sanitization. This allowed a crafted browser‑runner URL to inject unsanitized JavaScript that executed with the privileges of the Vitest server origin, enabling an attacker to extract the VITEST_API_TOKEN and issue authenticated API calls. The issue is fixed in versions 4.1.6 and 5.0.0‑beta.3.

Affected Systems

The vulnerability affects Vitest Browser Mode in all releases from 4.0.17 through 4.1.5 inclusive, and in 5.0.0‑beta.1 through 5.0.0‑beta.2 inclusive. Versions 4.1.6 and 5.0.0‑beta.3 contain the fix. All other newer releases are not affected.

Risk and Exploitability

The CVSS score of 9.6 indicates a severe risk, but the EPSS of less than 1% suggests a low probability of exploitation at present. The vulnerability is not listed in the CISA KEV catalog. An attacker would need to craft a browser‑based URL targeting the Vitest server's /__vitest_test__/ endpoint; the injected JavaScript would then execute with the privileges of the Vitest process, enabling token theft and unauthorized API usage. No special privileges or local access are required. The vulnerability has been fixed in Vitest releases 4.1.6 and 5.0.0‑beta‑3; all later versions are not affected.

Generated by OpenCVE AI on July 31, 2026 at 05:27 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Vitest to version 4.1.6 or later, or to 5.0.0‑beta.3 or newer, where the otelCarrier input is properly sanitized.
  • If upgrading is not immediately possible, restrict access to the /__vitest_test__/ endpoint or remove the otelCarrier query parameter from the URLs that trigger browser mode.
  • Validate and sanitize all user‑supplied query parameters, especially otelCarrier, before embedding them in JavaScript or HTML outputs to prevent cross‑site scripting (CWE‑79).
  • Monitor for unauthorized or unusually crafted URLs attempting to exploit the otelCarrier parameter and apply additional network‑level filtering if feasible.

Generated by OpenCVE AI on July 31, 2026 at 05:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-2h32-95rg-cppp Vitest browser mode serves unsanitized otelCarrier query parameter as inline script
History

Thu, 16 Jul 2026 00:30:00 +0000

Type Values Removed Values Added
First Time appeared Redhat
Redhat hummingbird
CPEs cpe:/a:redhat:hummingbird:1
Vendors & Products Redhat
Redhat hummingbird
References
Metrics threat_severity

None

threat_severity

Important


Wed, 15 Jul 2026 16:45:00 +0000

Type Values Removed Values Added
First Time appeared Vitest.dev
Vitest.dev vitest
Vendors & Products Vitest.dev
Vitest.dev vitest

Wed, 15 Jul 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 14 Jul 2026 20:00:00 +0000

Type Values Removed Values Added
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.
Title Vitest browser mode serves unsanitized otelCarrier query parameter as inline script
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 9.6, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H'}


Subscriptions

Redhat Hummingbird
Vitest.dev Vitest
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-15T13:20:14.275Z

Reserved: 2026-05-19T19:37:43.527Z

Link: CVE-2026-47428

cve-icon Vulnrichment

Updated: 2026-07-15T13:20:01.057Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-14T19:30:19Z

Links: CVE-2026-47428 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T05:30:07Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')