Cross-site scripting in vitest - CVE-2026-47428
Published: May 22, 2026
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.