CVE-2025-24964 | Remote Code Execution when accessing a malicious website while Vitest API server is listening

Exp

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: 2025-02-04 Last update: 2025-12-31 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2025-24964 is rated High Exploit Risk (80.2/100): CVSS Critical severity, with medium exploitation likelihood (EPSS 1.94%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2025-24964

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2025-24964

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-05-24 4.39% 1.94% -2.45%
2 2026-03-25 4.63% 4.39% -0.25%
3 2026-03-15 4.63%

Full EPSS history (9 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2025-24964

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
9.6 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 6.0 [email protected]
8.8 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 5.9 [email protected]

Weakness enumeration for CVE-2025-24964

GitHub Security Advisory for CVE-2025-24964

GHSA-9crc-q9x8-hgqq · Severity: critical · Ecosystem: npm — Vitest allows Remote Code Execution when accessing a malicious website while Vitest API server is listening

Affected software / configurations for CVE-2025-24964

Vendor Product Version Raw CPE
vitest.dev vitest <= 0.0.125 cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:node.js:*:*
vitest.dev vitest >= 1.0.0, < 1.6.1 cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:node.js:*:*
vitest.dev vitest >= 2.0.0, < 2.1.9 cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:node.js:*:*
vitest.dev vitest >= 3.0.0, < 3.0.5 cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:node.js:*:*

References for CVE-2025-24964

cvelogic Threat Intelligence