PT-2026-45491 · Vitest · Vitest

CVE-2026-47428

·

Published

2026-06-01

·

Updated

2026-07-16

CVSS v3.1

9.6

Critical

VectorAV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions Vitest versions 4.0.17 through 4.1.5 Vitest versions 5.0.0-beta.0 through 5.0.0-beta.2
Description In browser mode, the software serves the '/ vitest test /' endpoint where the otelCarrier query parameter is inserted directly into an inline module script. Because this value is treated as JavaScript source rather than data, a crafted URL can execute arbitrary JavaScript in the Vitest server origin. This can be used to recover the VITEST API TOKEN, which authenticates WebSocket APIs. In local setups, this token compromise can be chained to achieve server-side code execution by using the authenticated browser API to modify the vite.config.ts file, which is then executed by Node when the configuration reloads.
Recommendations Update Vitest to version 4.1.6 or 5.0.0-beta.3.

Exploit

Fix

XSS

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2026-47428
GHSA-2H32-95RG-CPPP
RHSA-2026:39058

Affected Products

Vitest