CVE-2025-24964
Remote Code Execution when accessing a malicious website while Vitest API server is listening
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.
Exposure status: unknown. This page does not establish whether an installed system is affected or corrected.
Severity and exploitation evidence
EPSS: 0.677% · score date 2026-11-19. EPSS is an estimated probability over the next 30 days, not proof of exploitation.
CISA KEV: not included in the checked catalog; exploitation may still occur. Last checked: 2026-11-19T16:57:41.748Z. Public exploit availability is not used to set this status.
CVSS 3.1 · 9.7 · published by GitHub_MCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Assessment source · checked 2026-11-19T12:57:28.399Z
Verification by field
| Field | Status | Checked at (UTC) | Source |
|---|---|---|---|
| kev | verified | 2026-11-19T16:57:41.748Z | CISA KEV |
| cvss | verified | 2026-11-19T12:57:28.399Z | CVE Program |
| epss | verified | 2026-11-19T16:04:40.588Z | FIRST EPSS |
| patches | verified | 2026-11-19T12:52:29.323Z | OSV |
| affected | verified | 2026-11-19T12:57:28.399Z | CVE Program |
| lifecycle | verified | 2026-11-19T12:57:28.399Z | CVE Program |
Affected versions and configuration
vitest-dev vitest; default status: unknown: <= 0.0.125 [affected; scheme: unspecified]; >= 1.0.0, < 1.6.1 [affected; scheme: unspecified]; >= 2.0.0, < 2.1.9 [affected; scheme: unspecified]; >= 3.0.0, < 3.0.5 [affected; scheme: unspecified]
Defaults, conditional configuration, package status and version schemes are retained below. A version range alone is not an exposure verdict.
CVE Program · cve-json · full conditions
{
"affected": [
{
"vendor": "vitest-dev",
"product": "vitest",
"versions": [
{
"status": "affected",
"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"
}
]
}
],
"additionalContainers": [
{
"title": "CISA ADP Vulnrichment",
"metrics": [
{
"other": {
"type": "ssvc",
"content": {
"id": "CVE-2025-24964",
"role": "CISA Coordinator",
"options": [
{
"Exploitation": "poc"
},
{
"Automatable": "no"
},
{
"Technical Impact": "total"
}
],
"version": "2.0.3",
"timestamp": "2025-02-04T19:45:47.197801Z"
}
}
}
],
"providerMetadata": {
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP",
"dateUpdated": "2025-02-12T20:51:28.286Z"
}
}
]
}Archived source JSONOSV · osv · full conditions
{
"id": "GHSA-9crc-q9x8-hgqq",
"aliases": [
"CVE-2025-24964"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.6.1"
}
]
}
],
"package": {
"name": "vitest",
"purl": "pkg:npm/vitest",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/02/GHSA-9crc-q9x8-hgqq/GHSA-9crc-q9x8-hgqq.json"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.1.9"
}
]
}
],
"package": {
"name": "vitest",
"purl": "pkg:npm/vitest",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/02/GHSA-9crc-q9x8-hgqq/GHSA-9crc-q9x8-hgqq.json"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "3.0.0"
},
{
"fixed": "3.0.5"
}
]
}
],
"package": {
"name": "vitest",
"purl": "pkg:npm/vitest",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/02/GHSA-9crc-q9x8-hgqq/GHSA-9crc-q9x8-hgqq.json"
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.0.125"
}
]
}
],
"package": {
"name": "vitest",
"purl": "pkg:npm/vitest",
"ecosystem": "npm"
},
"versions": [],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/02/GHSA-9crc-q9x8-hgqq/GHSA-9crc-q9x8-hgqq.json"
}
}
],
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
}
],
"upstream": [],
"withdrawn": null,
"references": [
{
"url": "https://github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq",
"type": "WEB"
},
{
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-24964",
"type": "ADVISORY"
},
{
"url": "https://github.com/vitest-dev/vitest/commit/191ef9e34c867d0efd04f49b3d38193a68e825dc",
"type": "WEB"
},
{
"url": "https://github.com/vitest-dev/vitest/commit/7ce9fbb4972d45c6fd34c843645ef6f549bbb241",
"type": "WEB"
},
{
"url": "https://github.com/vitest-dev/vitest/commit/e0fe1d81e2d4bcddb1c6ca3c5c3970d8ba697383",
"type": "WEB"
},
{
"url": "https://github.com/vitest-dev/vitest",
"type": "PACKAGE"
},
{
"url": "https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L32-L46",
"type": "WEB"
},
{
"url": "https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L66-L76",
"type": "WEB"
},
{
"url": "https://vitest.dev/config/#api",
"type": "WEB"
}
],
"relatedGitRanges": [],
"database_specific": {
"cwe_ids": [
"CWE-1385"
],
"severity": "CRITICAL",
"github_reviewed": true,
"nvd_published_at": "2025-02-04T20:15:50Z",
"github_reviewed_at": "2025-02-04T17:00:57Z"
}
}Archived source JSONCorrection evidence
Distribution packages and upstream releases are distinct. ESM channels may require the corresponding Ubuntu entitlement. Notes and branch ranges are not installable package versions. OSV fixed boundaries are ecosystem-specific version thresholds, not proof that a package is currently available or installed.
| Evidence type | Distribution / release | Package | Channel | Version or source note | Source |
|---|---|---|---|---|---|
| ecosystem-boundary | npm / package | vitest | Not a distribution channel | 1.6.1 | Official record |
| ecosystem-boundary | npm / package | vitest | Not a distribution channel | 2.1.9 | Official record |
| ecosystem-boundary | npm / package | vitest | Not a distribution channel | 3.0.5 | Official record |
Vendor notices and operational guidance
No connected vendor notice is available for this record.
Original sources and dates
- OSVConsulted: 2026-11-19T12:52:29.323ZArchived source JSON
Source publication: 2025-02-04T17:00:57.000Z
Source modification: 2025-02-04T22:04:09.000ZDocument fingerprint
8e2a78812a343f3a856262818c69ac6b6af8f2a671c28eb29cfee8f432352595 - CVE ProgramConsulted: 2026-11-19T12:57:28.399ZArchived source JSON
Source publication: 2025-02-04T19:36:50.509Z
Source modification: 2025-02-12T20:51:28.286ZDocument fingerprint
6f4b0dedf88a8cbdf0702d26e68218fadb3a9c10a514ccc69a4ccd16600167bf - CISA KEVConsulted: 2026-11-19T16:57:41.748ZArchived source JSON
Source publication: not supplied
Source modification: 2026-11-18T19:17:41.0354ZDocument fingerprint
a35fdc67c7d9802988dcfc1d3ff1198da327948d1db122ab7692ac201055ac56 - FIRST EPSSConsulted: 2026-11-19T16:04:40.588ZArchived source JSON
Source publication: not supplied
Source modification: not suppliedDocument fingerprint
f828727fd2419e9ee62887077d52e76b99e46a1d7a1ce89e08e7e861a70ba109
Official status history
- UNKNOWN → PUBLISHED · · evidence