GHSA-p63j-vcc4-9vmv: @vitest/browser: Browser Mode provider commands bypass the file-access permission gate
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.
References
- github.com/advisories/GHSA-p63j-vcc4-9vmv
- github.com/vitest-dev/vitest/commit/33f96a145ef09ca6a43b4e555eb273e64a87be23
- github.com/vitest-dev/vitest/commit/5c18dd267ff7f47f24cab2f615a16b37d90feb7f
- github.com/vitest-dev/vitest/commit/b795e36b34969bec50b47a9f29d26f799a6a04fb
- github.com/vitest-dev/vitest/pull/10674
- github.com/vitest-dev/vitest/pull/10679
- github.com/vitest-dev/vitest/pull/10680
- github.com/vitest-dev/vitest/releases/tag/v3.2.7
- github.com/vitest-dev/vitest/releases/tag/v4.1.10
- github.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.6
- github.com/vitest-dev/vitest/security/advisories/GHSA-p63j-vcc4-9vmv
Code Behaviors & Features
Detect and mitigate GHSA-p63j-vcc4-9vmv with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →