High severity · published Feb 4, 2025
CVE-2025-24964
Vitest is a testing framework powered by Vite
8.8
CVSS
0.7%
EPSS
No
On KEV
Description
Vitest is a testing framework powered by Vite. Affected versions are subject to arbitrary remote Code Execution when accessing a malicious website while Vitest API server is listening by Cross-site WebSocket hijacking (CSWSH) attacks. When `api` option is enabled (Vitest UI enables it), Vitest starts a WebSocket server. This WebSocket server did not check Origin header and did not have any authorization mechanism and was vulnerable to CSWSH attacks. This WebSocket server has `saveTestFile` API that can edit a test file and `rerun` API that can rerun the tests. An attacker can execute arbitrary code by injecting a code in a test file by the `saveTestFile` API and then running that file by calling the `rerun` API. This vulnerability can result in remote code execution for users that are using Vitest serve API. This issue has been patched in versions 1.6.1, 2.1.9 and 3.0.5. Users are advised to upgrade. There are no known workarounds for this vulnerability.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.7% · higher than 52% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
VI
Vitest · Vitest.dev
through 0.0.125; 1.0.0 before 1.6.1; 2.0.0 before 2.1.9; 3.0.0 before 3.0.5 · source: NVD
Affected product
VI
Vitest
Vitest.dev
More from Vitest
9.8
CVE-2026-53633
Vitest: Exposed Browser Mode API Can Proxy CDP and Overwrite Config Files, Leading to RCE
9.6
CVE-2026-47428
Vitest browser mode serves unsanitized otelCarrier query parameter as inline script
9.4
CVE-2026-73653
Vitest: Browser Mode provider commands bypass the file-access permission gate
7.5
CVE-2025-24963
Vitest is a testing framework powered by Vite
6.5
CVE-2026-112948
Vitest: Servers misapply `server.fs.deny`, serving `.env`, private keys, `.git`, and the API token file