Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2025-24964

CRITICAL 9.7EPSS 57%

Remote Code Execution when accessing a malicious website while Vitest API server is listening

Also known as GHSA-9crc-q9x8-hgqq

Mitigation

  • Upgrade vitest to one of 1.6.1, 2.1.9, 3.0.5 (or later in the same release line).

Who should check

  • Projects that depend on npm package vitest (>= 1.0.0, < 1.6.1)
  • Anyone running vitest-dev vitest <= 0.0.125; >= 1.0.0, < 1.6.1; >= 2.0.0, < 2.1.9; >= 3.0.0, < 3.0.5

Vulnerability facts

Affected
vitest >= 1.0.0, < 1.6.1
Fixed in
1.6.1, 2.1.9, 3.0.5
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
9.7 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: Required
  • Scope: Changed (impact reaches other components)
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
EPSS
0.89% chance of exploitation in 30 days (percentile 57, 2026-11-26)
CWE
CWE-1385
Published
Modified

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.

Affected and fixed versions

Package / productAffectedFixedSource
npm vitest>= 1.0.0, < 1.6.11.6.1, 2.1.9, 3.0.5osv
vitest-dev vitest<= 0.0.125; >= 1.0.0, < 1.6.1; >= 2.0.0, < 2.1.9; >= 3.0.0, < 3.0.5—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2025-24964. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-24964.md
Affected: vitest >= 1.0.0, < 1.6.1
Fixed in: 1.6.1, 2.1.9, 3.0.5

Steps:
1. Search this machine and project for vitest (npm), vitest-dev vitest: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2025-24964 being exploited?

There is no confirmed exploitation: CVE-2025-24964 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.89% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2025-24964?

Critical: CVSS 9.7 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.

Which versions are affected by CVE-2025-24964?

vitest >= 1.0.0, < 1.6.1.

Is there a fix for CVE-2025-24964?

Yes. Fixed in 1.6.1, 2.1.9, 3.0.5. Upgrade vitest to one of 1.6.1, 2.1.9, 3.0.5 (or later in the same release line).

How do I check if I'm affected by CVE-2025-24964?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors