<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>@Vitest/Browser (&gt;= 4.0.0, &lt; 4.1.10) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/@vitest/browser--4.0.0--4.1.10/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 21 Jul 2026 19:38:12 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/@vitest/browser--4.0.0--4.1.10/feed.xml" rel="self" type="application/rss+xml"/><item><title>@vitest/browser File Access Bypass Vulnerability (GHSA-p63j-vcc4-9vmv)</title><link>https://feed.craftedsignal.io/briefs/2026-07-vitest-browser-file-access-bypass/</link><pubDate>Tue, 21 Jul 2026 19:38:12 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-vitest-browser-file-access-bypass/</guid><description>A critical vulnerability in `@vitest/browser`'s Browser Mode allows arbitrary file system access due to a bypass of the `allowWrite` permission gate and lack of path confinement, enabling an attacker to read, create, overwrite, or delete files on the local filesystem where the Vitest process is running.</description><content:encoded><![CDATA[<p>A critical vulnerability (GHSA-p63j-vcc4-9vmv) in the <code>@vitest/browser</code> package, affecting versions prior to <code>3.2.7</code>, between <code>4.0.0</code> and <code>4.1.10</code>, and between <code>5.0.0-beta.1</code> and <code>5.0.0-beta.6</code>, has been identified. This flaw allows an attacker to bypass the <code>allowWrite</code> permission gate and path confinement mechanisms within Vitest's Browser Mode. The Browser Mode exposes built-in commands that interact with the local filesystem, such as <code>upload</code>, <code>takeScreenshot</code>, <code>screenshotMatcher</code>, <code>stopChunkTrace</code>, <code>deleteTracing</code>, and <code>annotateTraces</code>. These commands accept file paths from the browser without validating the <code>allowWrite</code> setting or confining paths to the project directory. Consequently, if the Browser Mode API is network-exposed (e.g., <code>test.api.host</code> is set, or the dev server is reachable remotely), a client can exploit this to read, create, overwrite, or delete files on the system where Vitest is running, even when <code>allowWrite</code> is explicitly set to <code>false</code>. While the writes are limited to specific content types (PNG, zip archives), the arbitrary file read capability poses a significant risk of sensitive data exfiltration.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li><strong>Initial Access</strong>: The attacker gains network access to the Vitest Browser Mode API, typically by exploiting a misconfigured <code>test.api.host</code> or a publicly exposed development server.</li>
<li><strong>API Interaction</strong>: The attacker sends a crafted request to a vulnerable Browser Mode command (e.g., <code>upload</code>, <code>takeScreenshot</code>, <code>deleteTracing</code>).</li>
<li><strong>Path Traversal/Absolute Path Injection</strong>: The attacker includes an absolute path or path traversal sequences (e.g., <code>../</code>) in the file path parameter of the command.</li>
<li><strong>Permission Bypass</strong>: The vulnerable command processes the client-supplied path without checking the <code>allowWrite</code> permission gate.</li>
<li><strong>Arbitrary File Operation</strong>: Depending on the command used, the Vitest process performs an operation on the specified arbitrary file path.</li>
</ol>
<ul>
<li><code>upload</code> or <code>annotateTraces</code>: Reads the contents of an arbitrary local file and discloses them to the attacker.</li>
<li><code>takeScreenshot</code>, <code>screenshotMatcher</code>, <code>stopChunkTrace</code>: Creates or overwrites files (e.g., PNGs, .zip archives) at arbitrary locations.</li>
<li><code>deleteTracing</code>: Deletes arbitrary files by path.</li>
</ul>
<ol start="6">
<li><strong>Impact</strong>: The attacker achieves arbitrary file read/write/delete capabilities, leading to data exfiltration, system manipulation, or denial of service.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The vulnerability allows an attacker with network access to the Vitest Browser Mode API to perform arbitrary file system operations on the host running the Vitest process. This can lead to severe consequences, including the exfiltration of sensitive data from any accessible file (e.g., configuration files, private keys, source code) via commands like <code>upload</code> or <code>annotateTraces</code>. Attackers can also compromise system integrity by creating, overwriting, or deleting critical files using commands such as <code>takeScreenshot</code> or <code>deleteTracing</code>. While writes are limited to specific file types (PNGs, zip archives), the ability to delete arbitrary files or overwrite existing ones with attacker-controlled, albeit type-restricted, content could lead to a denial of service or further system compromise. The severity is particularly high if the Vitest environment has elevated privileges or contains sensitive data.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li><strong>Patch Vulnerable Vitest Installations</strong>: Immediately update <code>@vitest/browser</code> to a fixed version: <code>&gt;= 3.2.7</code>, <code>&gt;= 4.1.10</code>, or <code>&gt;= 5.0.0-beta.6</code>.</li>
<li><strong>Network Segmentation</strong>: Ensure that the Vitest Browser Mode API (<code>test.api.host</code>) is not exposed to untrusted networks or the internet. Restrict network access to only trusted development environments.</li>
<li><strong>Principle of Least Privilege</strong>: Run Vitest processes with the minimum necessary file system permissions to limit the blast radius of any potential exploitation.</li>
<li><strong>Monitor for Anomalous File Activity</strong>: Implement logging and monitoring for unusual file read, write, or delete operations originating from Vitest processes that exceed expected behavior.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>supply-chain</category><category>vulnerability</category><category>file-access</category><category>RCE</category><category>web-dev</category></item></channel></rss>