CVE-2025-24964

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

HIGH
8.8
CVSS Score
Published: February 4, 2025 at 07:36 PM UTC
Updated: June 17, 2026 at 08:59 AM UTC
1 product affected across 1 vendorVitest

Using vitest by vitest-dev?

Get instant alerts when new vulnerabilities affect vitest - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.8
Exploit prediction
EPSS 0.7%
SSVC
PoC

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≤ 0.0.125v < 1.6.1v < 2.1.9v < 3.0.51.0.0 ≤ v < 1.6.12.0.0 ≤ v < 2.1.93.0.0 ≤ v < 3.0.5
Affected range stops below 1.6.1, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.1.9, so it looks safe — our inference, not a vendor statement
Affected range stops below 3.0.5, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

SSVC — Action Prioritization

SSVCPoCNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-1385

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card