CVE-2025-24964HIGH 8.8EPSS p45.4%

CVE-2025-24964CVE-2025-24964

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.

Scoring

CVSS 3.18.8 (HIGH)
VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS0.63% probability of exploitation · percentile 45.4% · 2026-06-19T12:03:05Z
Published2025-02-04
Last modified2025-12-31

Underlying weaknesses· 1

CWE-1385

References

  1. https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L32-L46
  2. https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L66-L76
  3. https://github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq
  4. https://vitest.dev/config/#api

1

TypeTargetConfidenceTier
WeaknessMissing Origin Validation in WebSocketscwe-13850%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CVE
CVE-2025-67489
CVE
Vite Vitejs Improper Access Control Vulnerability
CVE
CVE-2026-30649
CVE
CVE-2026-41934
CVE
CVE-2024-52011
CVE
CVE-2025-44022
Sourced from NVD + FIRST.org EPSS. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.