Remote Code Execution when accessing a malicious website while Vitest API server is listening (vitest-dev vitest)

CVE-2025-24964
CRITICAL 9.7

En bref

Source
NVD
EPSS
EPSS 0.68 % · centile 54 ()
État
PUBLISHED
Publiée
Mise à jour
Attribuée par
GitHub_M
Produits affectés
vitest-dev · vitest
Statut NVD
Analyzed

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.

Faiblesses (CWE)

  • CWE-1385 — Missing Origin Validation in WebSockets

Références

Scores

VersionScoreVecteurÉvalué par
CVSS 3.1CRITICAL 9.7CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HGitHub_M
CVSS 3.1CRITICAL 9.6CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HNVD · security-advisories@github.com (Secondary)
CVSS 3.1HIGH 8.8CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HNVD · nvd@nist.gov (Primary)

Avis

Références européennes

Configurations affectées (CPE NVD)

Produits affectés

ProduitVersions affectées
vitest-dev · vitest
affectée : <= 0.0.125
affectée : >= 1.0.0, < 1.6.1
affectée : >= 2.0.0, < 2.1.9
affectée : >= 3.0.0, < 3.0.5

Sources

SourceLicence
CVE List (CVEProject cvelistV5)CVE Program Terms of Use
EPSS (FIRST.org)FIRST — attribution requested
ENISA EUVDENISA — reproduction authorised, source acknowledged
NVD (NIST) via fkie-cad/nvd-json-data-feedsPublic domain — this product uses data from the NVD API but is not endorsed or certified by the NVD