GHSA-p63j-vcc4-9vmv is a critical-severity (CVSS 9.4) Path Traversal vulnerability in @vitest/browser. A fix is available for @vitest/browser — see the affected versions and patch details below.
@vitest/browser: Browser Mode provider commands bypass the file-access permission gate
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-p63j-vcc4-9vmv.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-p63j-vcc4-9vmv by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 380,066 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@vitest/browsernpmDescription
Summary
Browser Mode exposes a set of built-in "commands" that run on the Node.js side of the test runner and can touch the local filesystem (taking screenshots, managing Playwright traces, uploading files for <input type="file">, comparing screenshots).
Several of these commands accept a file path from the browser and act on it without checking the allowWrite permission gate and without confining the path to the project directory. A client that can reach the Browser Mode API can therefore read, create, overwrite, or delete files anywhere the Vitest process can access, even when allowWrite is false.
This matters most when the Browser Mode API is exposed to the network (for example test.api.host is set, or the dev server is reachable from another machine or origin). In that configuration allowWrite defaults to false precisely to block file access, and these commands bypass that protection. On a default localhost-only setup with trusted test code, there is no untrusted party in a position to exploit it. The gap still matters wherever you rely on allowWrite: false to contain untrusted test code, because these commands ignore that flag.
Affected commands and impact
| Command | Operation | Impact |
|---|---|---|
upload (Playwright + WebdriverIO) | Read | Arbitrary local file read; contents are loaded into the page and readable by test code. Highest-impact case. |
takeScreenshot (Playwright + WebdriverIO) | Write | Writes a PNG to an arbitrary path (absolute path used verbatim), creating parent directories. |
screenshotMatcher | Write | Writes reference/diff PNGs; directory derived from client path allows partial traversal. |
stopChunkTrace | Write | Writes a Playwright trace .zip to a path escapable via ../ in the trace name. |
deleteTracing | Delete | Deletes arbitrary files by path. |
annotateTraces | Read (disclosure) | Records a client-controlled attachment path that the reporter copies into the attachments directory, disclosing file contents. |
The writes do not let an attacker choose the file contents (they produce PNG images or trace archives), so the integrity impact is creating, overwriting, or deleting a file at an arbitrary path rather than writing a chosen payload. The reads (upload, annotateTraces) are more serious because they expose the full contents of an arbitrary file.
The fix adds, to every file-touching provider command, an allowWrite check for write/delete operations and path confinement to the project root (matching the existing fs command pattern), so client-supplied absolute paths and ../ traversal are rejected.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @vitest/browser | ≥ 4.0.0&&< 4.1.10 | 4.1.10npm install @vitest/browser@4.1.10 |
| 📦npm | @vitest/browser | all versions | 3.2.7npm install @vitest/browser@3.2.7 |
| 📦npm | @vitest/browser | ≥ 5.0.0-beta.1&&< 5.0.0-beta.6 | 5.0.0-beta.6npm install @vitest/browser@5.0.0-beta.6 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @vitest/browser, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @vitest/browser to 4.1.10 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-p63j-vcc4-9vmv is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Making Browser Mode API unreachable outside of local machine by making it listen only on localhost.Source: Red Hat security advisory for GHSA-p63j-vcc4-9vmv (CC BY 4.0)
Frequently Asked Questions
Is GHSA-p63j-vcc4-9vmv in your dependencies?
Find it across npm, including transitive dependencies.