Vitest: Exposed Browser Mode API Can Proxy CDP and Overwrite Config Files, Leading to RCE
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 3.2.5, 4.1.8, 5.0.0-beta.4, 0.1.24
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: poc
- Automatable: yes
- Technical impact: total
Summary
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.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: poc · Automatable: yes · Technical impact: total
- Record last updated
Affected versions
- vitest-dev vitest
From 3.0.0 · fixed in 3.2.5; From 4.0.0 · fixed in 4.1.8; From 5.0.0-beta.0 · fixed in 5.0.0-beta.4
- @vitest/browsernpm
From 5.0.0-beta.0 · fixed in 5.0.0-beta.4
- @vitest/browsernpm
From 4.0.0 · fixed in 4.1.8
- @vitest/browsernpm
From 3.0.0 · fixed in 3.2.5
- vite-plusnpm
fixed in 0.1.24