Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

@vitest/browser: Browser Mode provider commands bypass the file-access permission gate

0
Critical
Published: 07/21/2026 (07/21/2026, 19:36:12 UTC)
Source: GCVE Database
Product: @vitest/browser

Description

A vulnerability in @vitest/browser's Browser Mode allows certain built-in commands to bypass the file-access permission gate. These commands can read, write, or delete files anywhere accessible by the Vitest process, ignoring the allowWrite flag and path confinement. This is particularly risky when the Browser Mode API is exposed beyond localhost, enabling arbitrary file read and modification by untrusted clients. The vulnerability affects versions >=4.0.0 <4.1.10 and <3.2.7. A fix is planned to enforce allowWrite checks and restrict paths to the project root.

CVSS v3.1

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L

Affected software

npmghsa
@vitest/browser
Affected versions
>=4.0.0 <4.1.10
npmghsa
@vitest/browser
Affected versions
<3.2.7
npmghsa
@vitest/browser
Affected versions
>=5.0.0-beta.1 <5.0.0-beta.6

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/22/2026, 00:56:23 UTC

Technical Analysis

The @vitest/browser Browser Mode exposes commands running on the Node.js side that interact with the local filesystem. Several commands accept file paths from the browser and perform operations without verifying the allowWrite permission or restricting paths to the project directory. This allows clients with access to the Browser Mode API to read arbitrary local files, write PNG screenshots or Playwright trace archives to arbitrary locations, and delete files, even when allowWrite is false. The vulnerability is most impactful when the API is network-exposed, as allowWrite defaults to false to block file access in such cases. The fix involves adding allowWrite checks and path confinement to all file-touching commands, rejecting absolute paths and directory traversal sequences.

Potential Impact

An attacker able to reach the Browser Mode API can read arbitrary local files, exposing sensitive data. They can also create, overwrite, or delete files at arbitrary paths, though write operations are limited to generated PNG or trace archive files rather than attacker-controlled content. This leads to confidentiality breaches and potential integrity loss of files accessible by the Vitest process. The vulnerability is critical due to the ability to bypass intended file access restrictions and the potential for remote exploitation if the API is exposed beyond localhost.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The planned fix adds allowWrite permission checks for write and delete operations and confines file paths to the project root, rejecting absolute paths and directory traversal. Until a patch is available, avoid exposing the Browser Mode API to untrusted networks or clients, and do not rely solely on allowWrite: false for security containment.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-p63j-vcc4-9vmv
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
CRITICAL
Cvss Version
3.1

Threat ID: 6a600ac39c2644c7f8fe33ce

Added to database: 07/22/2026, 00:11:47 UTC

Last enriched: 07/22/2026, 00:56:23 UTC

Last updated: 07/22/2026, 02:11:23 UTC

Views: 6

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses