cve.bz

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

8.8 highExploit referenceEPSS 0.7%Fix available

High (8.8) in vitest.dev vitest. EPSS 0.7% estimated probability of exploitation activity in the next 30 days. Fixed in vitest 1.6.1, 2.1.9, 3.0.5.

On this page
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.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
0.7% (unchanged from 0.7% a week ago; 0.7% 30 days ago) estimated probability of exploitation activity in the next 30 days; 53rd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: total, assessed 2025-02-04. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-1385 Missing Origin Validation in WebSockets
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-24964 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-24964?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-24964?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-24964 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
vitest.dev:vitestthrough 0.0.125
vitest.dev:vitestfrom 1.0.0 before 1.6.1
vitest.dev:vitestfrom 2.0.0 before 2.1.9
vitest.dev:vitestfrom 3.0.0 before 3.0.5

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-9crc-q9x8-hgqqnpmvitest>=1.0.0 <1.6.11.6.1
GHSA-9crc-q9x8-hgqqnpmvitest>=2.0.0 <2.1.92.1.9
GHSA-9crc-q9x8-hgqqnpmvitest>=3.0.0 <3.0.53.0.5
GHSA-9crc-q9x8-hgqqnpmvitest<=0.0.125no fix published

References

Check your stackJSON