Cross-site scripting in vitest - CVE-2026-47428

 

Cross-site scripting in vitest - CVE-2026-47428

Published: May 22, 2026


Vulnerability identifier: #VU132147
CSH Severity: Medium
CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U/U:Green
CVE-ID: CVE-2026-47428
CWE-ID: CWE-79
Exploitation vector: Remote access
Exploit availability: No public exploit available
Vendor: Vitest
Affected software:
vitest

Detailed vulnerability description

The vulnerability allows a remote attacker to execute arbitrary JavaScript in the Vitest server origin.

The vulnerability exists due to cross-site scripting in the browser runner page at /__vitest_test__/ when processing the otelCarrier query parameter. A remote attacker can send a specially crafted browser-runner URL to execute arbitrary JavaScript in the Vitest server origin.

User interaction is required to open or navigate to a crafted browser-runner URL while the Vitest browser server is running. In the default local browser-mode setup, the resulting same-origin script execution can recover the embedded VITEST_API_TOKEN and be chained to authenticated API calls, including server-side code execution.


How to mitigate CVE-2026-47428

Install security update from vendor's website.

Sources