Vitest
Vitest: Exposed Browser Mode API Can Proxy CDP and Overwrite Config Files, Leading to RCE
Vitest is a testing framework powered by Vite. From 3.0.0 until 3.2.5, 4.1.8, and 5.0.0-beta.4, Vitest Browser Mode exposed a cdp() API that forwarded raw Chrome DevTools Protocol methods without being gated by allowWrite or allowExec, allowing a remote client with exposed browser API metadata to use CDP Page.setDownloadBehavior and Runtime.evaluate to overwrite vite.config.ts and execute attacker-controlled Node.js code. This issue is fixed in versions 3.2.5, 4.1.8, and 5.0.0-beta.
First public PoC
None yetno public PoC found
Public PoCs00 on GitHub
CVSS9.8critical · scored by CNA · CWE-749
CISA KEV
Not listednot known exploited
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
vitest-dev vitest
- >= 3.0.0, < 3.2.5
- >= 4.0.0, < 4.1.8
- >= 5.0.0-beta.0, < 5.0.0-beta.4
Fixed in 3.2.5, 4.1.8, 5.0.0-beta.4
Mitigation
Upgrade vitest to 3.2.5 or 4.1.8 or 5.0.0-beta.4 or later.
References
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.