CVE-2025-24964: vitest-dev vitest Missing Origin Validation in WebSockets
Vulnerability summary
CVE-2025-24964 is a critical (CVSS 9.7) Missing Origin Validation in WebSockets vulnerability in vitest-dev vitest. EPSS estimates a 0.68% chance of exploitation in the next 30 days, higher than 51.6% of scored vulnerabilities. 1 public exploit is recorded.
Timeline
- 04-02-2025PublishedVulnerability first disclosed.
- 12-02-2025Last modifiedVulnerability information updated.
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 metrics
3 scores · 3 sources · 1 version- OSV · NpmEcosystem advisory · calculated9.6CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HDiffers
- NVDNIST8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HDiffers
EPSS trend
Probability
0.68%
Chance of exploitation in the next 30 days
Percentile
52%
Versus all other CVEs
30-day change
0.00 pp
From 0.68% on 20-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
1 foundVitest
Maturity: poc
Weaknesses
CWE · root causeAffected systems
Npm1 product
- vitest≥ 1.0.0, < 1.6.1 | ≥ 2.0.0, < 2.1.9 | ≥ 3.0.0, < 3.0.5 | ≤ 0.0.125
Vitest-dev1 product
- vitest≤ 0.0.125 | ≥ 1.0.0, < 1.6.1 | ≥ 2.0.0, < 2.1.9 | ≥ 3.0.0, < 3.0.5
Vitest.dev1 product
- vitest≤ 0.0.125 | ≥ 1.0.0, < 1.6.1 | ≥ 2.0.0, < 2.1.9 | ≥ 3.0.0, < 3.0.5
3 vendors · 3 products
References
9 links- github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqqX Refsource CONFIRMWEBExploitVendor Advisory
- github.com/vitest-dev/vitestPACKAGE