CVE-2025-24964
Detail
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.
Metrics
NVD enrichment efforts reference publicly available information to associate
vector strings. CVSS information contributed by other sources is also
displayed.
CVSS 4.0 Severity and Vector Strings:
NVD assessment
not yet provided.
CVSS 3.x Severity and Vector Strings:
Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
CVSS 2.0 Severity and Vector Strings:
Base
Score:
NVD assessment
not yet provided.
References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving NIST webspace.
We have provided these links to other web sites because they
may have information that would be of interest to you. No
inferences should be drawn on account of other sites being
referenced, or not, from this page. There may be other web
sites that are more appropriate for your purpose. NIST does
not necessarily endorse the views expressed, or concur with
the facts presented on these sites. Further, NIST does not
endorse any commercial products that may be mentioned on
these sites. Please address comments about this page to [email protected].
Weakness Enumeration
| CWE-ID |
CWE Name |
Source |
|
CWE-1385
|
Missing Origin Validation in WebSockets |
GitHub, Inc.
|
Change History
4 change records found show changes
CVE Modified by CISA-ADP
6/17/2026 4:59:53 AM
| Action |
Type |
Old Value |
New Value |
| Added |
SSVC |
{"timestamp":"2025-02-04T19:45:47.197801Z","id":"CVE-2025-24964","options":[{"exploitation":"poc"},{"automatable":"no"},{"technicalImpact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}
|
CVE Modified by GitHub, Inc.
6/17/2026 4:59:53 AM
| Action |
Type |
Old Value |
New Value |
| Added |
Affected |
[{"vendor":"vitest-dev","product":"vitest","versions":[{"version":"<= 0.0.125","status":"affected"},{"version":">= 1.0.0, < 1.6.1","status":"affected"},{"version":">= 2.0.0, < 2.1.9","status":"affected"},{"version":">= 3.0.0, < 3.0.5","status":"affected"}]}]
|
Initial Analysis by NIST
12/31/2025 9:50:11 AM
| Action |
Type |
Old Value |
New Value |
| Added |
CVSS V3.1 |
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
|
| Added |
CPE Configuration |
OR
*cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:node.js:*:* versions up to (including) 0.0.125
*cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:node.js:*:* versions from (including) 1.0.0 up to (excluding) 1.6.1
*cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:node.js:*:* versions from (including) 2.0.0 up to (excluding) 2.1.9
*cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:node.js:*:* versions from (including) 3.0.0 up to (excluding) 3.0.5
|
| Added |
Reference Type |
GitHub, Inc.: https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L32-L46 Types: Product
|
| Added |
Reference Type |
GitHub, Inc.: https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L66-L76 Types: Product
|
| Added |
Reference Type |
GitHub, Inc.: https://github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq Types: Exploit, Vendor Advisory
|
| Added |
Reference Type |
GitHub, Inc.: https://vitest.dev/config/#api Types: Product
|
New CVE Received from GitHub, Inc.
2/04/2025 3:15:50 PM
| Action |
Type |
Old Value |
New Value |
| Added |
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.
|
| Added |
CVSS V3.1 |
AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
|
| Added |
CWE |
CWE-1385
|
| Added |
Reference |
https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L32-L46
|
| Added |
Reference |
https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L66-L76
|
| Added |
Reference |
https://github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq
|
| Added |
Reference |
https://vitest.dev/config/#api
|
Quick Info
CVE Dictionary Entry: CVE-2025-24964 NVD
Published Date: 02/04/2025 NVD
Last Modified: 06/17/2026
Source: GitHub, Inc.
|