9.7

CVE-2025-24964: Remote Code Execution when accessing a malicious website while Vitest API server is listening

Analyzed
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 53.6% of scored vulnerabilities. 1 public exploit is recorded.

Priority
Prioritisepublic exploit

Public exploit (GitHub, Date unknown)

CIRCL last checked 05-12-2026

Source freshness unavailable

How is this decided?
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 listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware 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

54%

Versus all other CVEs

30-day change

No change 0.00 pp

From 0.68% on 04-11-2026

04-11-202604-12-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

1 found
  • githubUnverified

    Vitest

    Maturity: poc

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.

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