9.7

CVE-2025-24964: vitest-dev vitest Missing Origin Validation in WebSockets

CVSS: 9.7v3.1CriticalAnalyzed
AliasesGHSA-9crc-q9x8-hgqq
Published 04-02-2025Last modified 12-02-2025

Vulnerability summary

CVE-2025-24964 is a critical (CVSS 9.7) Missing Origin Validation in WebSockets vulnerability in vitest-dev vitest. EPSS estimates a 0.68% chance of exploitation in the next 30 days, higher than 51.6% of scored vulnerabilities. 1 public exploit is recorded.

Overall risk
70/100
0100
High · default modelHow is this calculated?
CVSS score
9.7/10
010
Critical · v3.1 (CVE.org)
EPSS score
0.68%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits1github

Timeline

  1. 04-02-2025
    PublishedVulnerability first disclosed.
  2. 12-02-2025
    Last modifiedVulnerability information updated.

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 metrics

3 scores · 3 sources · 1 version

EPSS trend

Probability

0.68%

Chance of exploitation in the next 30 days

Percentile

52%

Versus all other CVEs

30-day change

0.00 pp

From 0.68% on 20-09-2026

20-09-202620-10-2026
EPSS score
0.68%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

1 found
  • githubUnverified

    Vitest

    Maturity: poc

Weaknesses

CWE · root cause

Affected systems

Npm1 product
  • vitest≥ 1.0.0, < 1.6.1 | ≥ 2.0.0, < 2.1.9 | ≥ 3.0.0, < 3.0.5 | ≤ 0.0.125
Vitest-dev1 product
  • vitest≤ 0.0.125 | ≥ 1.0.0, < 1.6.1 | ≥ 2.0.0, < 2.1.9 | ≥ 3.0.0, < 3.0.5
Vitest.dev1 product
  • vitest≤ 0.0.125 | ≥ 1.0.0, < 1.6.1 | ≥ 2.0.0, < 2.1.9 | ≥ 3.0.0, < 3.0.5

3 vendors · 3 products

References

9 links