Vulnerability in Vitest-Dev Vitest
CVE-2025-24964
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.
Published · last modified .
CVSS v3 metric
CVSS v3 base score 9.6 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.
EPSS exploit prediction
EPSS: 0.007 (50.5th percentile), scored .
Very low probability of exploitation in the next 30 days; routine patching cadence is appropriate. 51st percentile — 50.5% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.
EPSS over last 30 days · oldest: 0.007 · newest: 0.007 · change: 0.000
Affected products
- Vitest-Dev Vitest — versions <= 0.0.125, >= 1.0.0, < 1.6.1, >= 2.0.0, < 2.1.9
- Vitest.dev Vitest
Weakness classification (CWE)
References
- github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq (Exploit, Vendor Advisory)
- github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/pack… (Product)
- github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/pack… (Product)
- vitest.dev/config/ (Product)
Frequently asked questions
- What is CVE-2025-24964?
- CVE-2025-24964 is a critical-severity vulnerability in Vitest-Dev Vitest, classified under CWE-1385. CVSS score: 9.6/10. Published 2025-02-04.
- How severe is CVE-2025-24964?
- Critical severity. CVSS v3 base score is 9.6 out of 10.