{"schemaVersion":3,"id":"CVE-2025-24964","aliases":["GHSA-9crc-q9x8-hgqq"],"status":"published","duplicateOf":null,"title":null,"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.","dates":{"published":"2025-02-04T19:36:50.509Z","modified":"2025-02-12T20:51:28.286Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":9.7,"severity":"critical","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":9.7,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Npm","score":9.6,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","exploitability":7.2,"impact":10,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00682,"percentile":0.51852,"severity":"low","asOf":"2026-10-21T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-21T00:00:00.000Z","baselineScore":0.00682},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00682,"percentile":0.51852}],"last30":[{"date":"2026-09-21T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00682,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.00682,"percentile":0.51852}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"GITHUB_VITEST-DEV_VITEST","name":"Vitest","source":"github","url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq","maturity":"poc","reliabilityScore":0.3,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-1385","name":"Missing Origin Validation in WebSockets","description":"The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid.","type":"weakness","status":"Incomplete","abstraction":"Variant","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/1385.html"}],"affected":[{"vendor":"Npm","product":"vitest","name":"vitest","label":"vitest","ecosystem":"Npm","cpePart":null,"purl":"pkg:npm/vitest","purlType":"npm","versions":[{"text":"≥ 1.0.0, < 1.6.1","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.0, < 2.1.9","noFixRecorded":false,"fixedIn":null},{"text":"≥ 3.0.0, < 3.0.5","noFixRecorded":false,"fixedIn":null},{"text":"≤ 0.0.125","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 1.0.0, < 1.6.1 | ≥ 2.0.0, < 2.1.9 | ≥ 3.0.0, < 3.0.5 | ≤ 0.0.125","eol":null,"hubHref":null},{"vendor":"vitest-dev","product":"vitest","name":"vitest","label":"vitest","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≤ 0.0.125","noFixRecorded":false,"fixedIn":null},{"text":"≥ 1.0.0, < 1.6.1","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.0, < 2.1.9","noFixRecorded":false,"fixedIn":null},{"text":"≥ 3.0.0, < 3.0.5","noFixRecorded":false,"fixedIn":null}],"versionsText":"≤ 0.0.125 | ≥ 1.0.0, < 1.6.1 | ≥ 2.0.0, < 2.1.9 | ≥ 3.0.0, < 3.0.5","eol":null,"hubHref":"/vendor/vitest-dev/vitest"},{"vendor":"vitest.dev","product":"vitest","name":"vitest","label":"vitest","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≤ 0.0.125","noFixRecorded":false,"fixedIn":null},{"text":"≥ 1.0.0, < 1.6.1","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.0, < 2.1.9","noFixRecorded":false,"fixedIn":null},{"text":"≥ 3.0.0, < 3.0.5","noFixRecorded":false,"fixedIn":null}],"versionsText":"≤ 0.0.125 | ≥ 1.0.0, < 1.6.1 | ≥ 2.0.0, < 2.1.9 | ≥ 3.0.0, < 3.0.5","eol":null,"hubHref":"/vendor/vitestdev/vitest"}],"affectedCount":3,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq","label":"github.com/vitest-dev/vitest/security/advisories/GHSA-9crc-q9x8-hgqq","hostname":"github.com","tags":["X Refsource CONFIRM","WEB","Exploit","Vendor Advisory"]},{"url":"https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L32-L46","label":"github.com/vitest-dev/…","hostname":"github.com","tags":["X Refsource MISC","WEB","Product"]},{"url":"https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L66-L76","label":"github.com/vitest-dev/…","hostname":"github.com","tags":["X Refsource MISC","WEB","Product"]},{"url":"https://vitest.dev/config/#api","label":"vitest.dev/config/","hostname":"vitest.dev","tags":["X Refsource MISC","WEB","Product"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24964","label":"nvd.nist.gov/vuln/detail/CVE-2025-24964","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/vitest-dev/vitest/commit/191ef9e34c867d0efd04f49b3d38193a68e825dc","label":"github.com/vitest-dev/vitest/commit/191ef9e34c867d0efd04f49b3d38193a68e825dc","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/vitest-dev/vitest/commit/7ce9fbb4972d45c6fd34c843645ef6f549bbb241","label":"github.com/vitest-dev/vitest/commit/7ce9fbb4972d45c6fd34c843645ef6f549bbb241","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/vitest-dev/vitest/commit/e0fe1d81e2d4bcddb1c6ca3c5c3970d8ba697383","label":"github.com/vitest-dev/vitest/commit/e0fe1d81e2d4bcddb1c6ca3c5c3970d8ba697383","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/vitest-dev/vitest","label":"github.com/vitest-dev/vitest","hostname":"github.com","tags":["PACKAGE"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2025-02-04T19:36:50.509Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2025-02-12T20:51:28.286Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":70,"level":"high","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-21T23:10:55.395Z","stale":false,"partial":false}}