Remote code execution via cross-origin WebSocket commands
Published Feb 4, 2025 · Updated Feb 12, 2025
Code execution in affected Vitest releases allows remote attackers to run arbitrary code via a malicious website and an enabled API server. The WebSocket upgrade path accepts cross-origin, unauthenticated connections, letting saveTestFile overwrite a registered test file before rerun executes the injected JavaScript. Exploitation requires the Vitest API server or UI to be listening and a user to visit attacker-controlled web content; the code runs with the Vitest process's access.
Summary
What happened
Code execution in affected Vitest releases allows remote attackers to run arbitrary code via a malicious website and an enabled API server. The WebSocket upgrade path accepts cross-origin, unauthenticated connections, letting saveTestFile overwrite a registered test file before rerun executes the injected JavaScript. Exploitation requires the Vitest API server or UI to be listening and a user to visit attacker-controlled web content; the code runs with the Vitest process's access.
The record
- CVE
- CVE-2025-24964
- Published
- Feb 4, 2025
- Updated
- Feb 12, 2025
- Vendor
- VoidZero
- Product
- Vitest
- Classifications
- CWE-1385, T1204.001, T1059.007
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Feb 4, 2025CVE publishedPublication date reported by the CVE source.
- Feb 12, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=<= 0.0.125
- Affected versionversion=>= 1.0.0, < 1.6.1
- Affected versionversion=>= 2.0.0, < 2.1.9
- Affected versionversion=>= 3.0.0, < 3.0.5
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- Maintainer cross-site WebSocket hijacking proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo