Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @vitest/browser
  4. ›
  5. GHSA-p63j-vcc4-9vmv

GHSA-p63j-vcc4-9vmv: @vitest/browser: Browser Mode provider commands bypass the file-access permission gate

July 21, 2026

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 →

Affected versions

All versions before 3.2.7, all versions starting from 4.0.0 before 4.1.10, all versions starting from 5.0.0-beta.1 before 5.0.0-beta.6

Fixed versions

  • 3.2.7
  • 4.1.10
  • 5.0.0-beta.6

Solution

Upgrade to versions 3.2.7, 4.1.10, 5.0.0-beta.6 or above.

Impact 9.4 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-552: Files or Directories Accessible to External Parties
  • CWE-862: Missing Authorization

Source file

npm/@vitest/browser/GHSA-p63j-vcc4-9vmv.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:17:48 +0000.