CVE-2025-24964

HIGH EPSS 45.6%
Published Feb 4, 20251y ago · Modified Jun 17, 20262w ago
8.8 CVSS 3.1
High
Find Similar
Published Feb 4, 2025 1y ago
Last Modified Jun 17, 2026 2w ago

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 Details

Base Score
8.8
Exploitability
2.8
Impact
5.9
Vector string
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attack Vector Network
Attack Complexity Low
Privileges Required None
User Interaction Required
Scope Unchanged
Confidentiality High
Integrity High
Availability High

Threat Intelligence

EPSS Exploit Probability
45.6% percentile
Exploit & Patch Status
Public Exploit Known
No Patch Available

Weaknesses 1

CWE-1385

Affected Products 4

VendorProductVersionRange
vitest.devvitest* ≤0.0.125
vitest.devvitest*≥1.0.0  –  <1.6.1
vitest.devvitest*≥2.0.0  –  <2.1.9
vitest.devvitest*≥3.0.0  –  <3.0.5

References 4

  • github.com https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L32-L46
    Product
  • github.com https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L66-L76
    Product
  • github.com https://github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq
    ExploitVendor Advisory
  • vitest.dev https://vitest.dev/config/#api
    Product

Remediation

No remediation data recorded yet

Check vendor advisories and the NVD entry for patch availability.