Skip to main content

Vitest Browser Mode CVE-2026-53633

| EUVDEUVD-2026-44403 CRITICAL
Exposed Dangerous Method or Function (CWE-749)
2026-06-15 https://github.com/vitest-dev/vitest GHSA-g8mr-85jm-7xhm
9.8
CVSS 3.1 · Vendor: https://github.com/vitest-dev/vitest
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Scan LAN for Vitest port
  2. Delivery
    Fetch /__vitest_test__/ runner page
  3. Exploit
    Extract API token, session id, project root
  4. Install
    Open tester WebSocket to /__vitest_browser_api__
  5. C2
    Send CDP Page.setDownloadBehavior to project root
  6. Execute
    Send CDP Runtime.evaluate to download malicious vite.config.ts
  7. Impact
    Vitest reloads config and executes Node.js payload

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Dangerous method exposure prevention
Exploitation Conditions

Requires: (1) a Vitest project running Browser Mode (test.browser.enabled=true) with a CDP-capable provider, specifically Playwright Chromium; (2) the browser API server bound to a network-reachable interface such as browser.api.host='0.0.0.0' (the default localhost bind is not directly exploitable from off-host); (3) an active browser test session at the time of attack so VITEST_API_TOKEN, sessionId, project name and root are exposed on /__vitest_test__/; (4) network reachability from the attacker to the Vitest port (default 63315). No user interaction or authentication is required beyond scraping the runner page that the server itself publishes. Notably, the documented allowWrite:false / allowExec:false configuration does NOT limit exploitation - bypassing those gates is the core of the bug.

Impact

The vendor CVSS 3.1 vector AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (9.8) reflects unauthenticated network RCE, and the published GHSA reproduction backs that with concrete steps - publicly available exploit code exists, which is a meaningful signal even without a KEV listing. However, real-world risk is materially constrained: exploitation only applies to Vitest projects that have explicitly bound the Browser Mode API to a non-loopback interface (a non-default, developer-opt-in deployment), require an active browser test session at attack time, and require a CDP-capable provider such as Playwright Chromium. EPSS and KEV signals are not provided in the input, so widespread automated exploitation cannot be confirmed; the realistic threat model is developer laptops or CI runners reachable from a hostile LAN, internet exposure, or co-located malicious processes able to reach the bound port. Net: the CVSS 9.8 is technically correct but overstates baseline risk for the default localhost deployment - treat as high priority for any team using --browser.api.host=0.0.0.0 or equivalent, lower for default localhost-only usage.

Exploit ScenarioDerived

A developer runs Vitest Browser Mode in watch mode with --browser.api.host=0.0.0.0 on a laptop joined to a coffee-shop or corporate Wi-Fi; an attacker on the same network fetches /__vitest_test__/, scrapes VITEST_API_TOKEN, sessionId, project name and root, then opens a WebSocket to /__vitest_browser_api__ as a tester client. Using sendCdpEvent the attacker calls Page.setDownloadBehavior to point downloads at the project root and Runtime.evaluate to trigger an anchor-click download of a malicious vite.config.ts; Vitest's watcher reloads the new config and executes attacker-controlled Node.js on the host. The reproduction script in the GHSA advisory makes this turnkey for any attacker who can reach the bound port.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 15, 2026

Remote code execution in Vitest Browser Mode (npm @vitest/browser 3.0.0-3.2.4, 4.0.0-4.1.7, 5.0.0-beta.0-5.0.0-beta.3) allows remote attackers to overwrite the project's vite.config.ts and execute arbitrary Node.js code on the host when the browser API server is bound to a network-reachable interface (e.g. --browser.api.host=0.0.0.0). The flaw stems from the cdp() API forwarding raw Chrome DevTools Protocol calls over the browser WebSocket RPC without honoring the allowWrite/allowExec gates that normally restrict Browser Mode. Publicly available exploit code exists in the GHSA-g8mr-85jm-7xhm advisory's step-by-step reproduction, though no CISA KEV listing has been issued.

RemediationAI

Upgrade to the vendor-released patched versions: @vitest/browser 3.2.5 for the 3.x line, 4.1.8 for the 4.x line, or 5.0.0-beta.4 for the 5.x beta line, and vite-plus 0.1.24, per https://github.com/vitest-dev/vitest/security/advisories/GHSA-g8mr-85jm-7xhm. Until patched, the highest-leverage mitigation is to stop binding the Browser Mode API to non-loopback interfaces - remove --browser.api.host=0.0.0.0 and any equivalent test.browser.api.host setting so the WebSocket RPC is reachable only on localhost (side effect: remote browser/CI scenarios that intentionally relied on the network bind will need an SSH tunnel or reverse proxy with its own auth). For developers who must expose the port, restrict it with a host firewall to known tester IPs and avoid running Vitest Browser Mode on shared/multi-tenant hosts; also make vite.config.ts read-only or run tests in an ephemeral container so a config overwrite does not yield persistent host code execution. Switching to a non-CDP provider (e.g. preview/webdriver-based) removes the cdp() attack path but at the cost of losing Playwright/Chromium-specific features.

Affected VersionsENISA

vitest 3.0.0, < 3.2.5
vitest 5.0.0-beta.0, < 5.0.0-beta.4
vitest 4.0.0, < 4.1.8

Affected Packages

npm @vitest/browser fix: 3.2.5, 4.1.8, 5.0.0-beta.4
npm vite-plus fix: 0.1.24
euvd vitest_3_0_0 fix: 3.2.5
euvd vitest_4_0_0 fix: 4.1.8
euvd vitest_5_0_0_beta_0 fix: 5.0.0-beta.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 5 packages in npm, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Vitest is a Vite-native JavaScript test runner; its Browser Mode runs tests inside a real browser driven by a CDP-capable provider such as Playwright Chromium. The vulnerable surface is the @vitest/browser package's cdp() helper, which proxies arbitrary Chrome DevTools Protocol methods (Page.setDownloadBehavior, Runtime.evaluate, etc.) through a WebSocket RPC endpoint at /__vitest_browser_api__. This maps to CWE-749 (Exposed Dangerous Method or Function): a powerful internal API is reachable without the authorization checks applied to neighboring write/exec features, so the security policy 'allowWrite:false, allowExec:false' is silently bypassed for any operation routed through CDP. The generated runner page at /__vitest_test__/ additionally leaks VITEST_API_TOKEN, sessionId, project name, and root path, providing all material needed to authenticate to the WebSocket RPC.

Know when Node.js gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/vitest-dev/vitest) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 9.0 CRITICAL

Network-reachable RCE with no auth, but AC:H because exploitation requires a non-default network bind and an active browser session; S:C since browser-scope CDP bypass yields host-OS code execution.

3.1 AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Red Hat 8.1 HIGH

Primary rating from Vendor (https://github.com/vitest-dev/vitest).

CVSS VectorVendor: https://github.com/vitest-dev/vitest

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

Summary

Vitest Browser Mode exposes a cdp() API that forwards raw Chrome DevTools Protocol (CDP) methods over the Vitest browser WebSocket RPC. CDP is not gated by browser.api.allowWrite, browser.api.allowExec, api.allowWrite, or api.allowExec.

As a result, disabling Browser Mode write and exec operations does not prevent a browser API client from using CDP to perform equivalent actions. In a verified reproduction with allowWrite: false and allowExec: false, CDP Page.setDownloadBehavior set the browser download directory to the project root, and CDP Runtime.evaluate downloaded a controlled vite.config.ts. Vitest reloaded the changed config and executed attacker-controlled Node.js code.

When the Browser Mode API is also exposed to the network, this becomes remotely exploitable because the generated browser runner page exposes the API token, active session id, project name, and project root path needed to connect to the browser WebSocket API and select the target download directory.

Impact

This affects Browser Mode projects using a CDP-capable provider, such as Playwright Chromium, when the browser API server is exposed to the network, for example with --browser.api.host=0.0.0.0.

In this mode Vitest warns that write and exec operations are disabled by default, but the generated browser runner page exposes enough metadata for a remote client to authenticate to the browser WebSocket API while an active session exists. This includes the browser API token, active session id, project name, and serialized test config including the project root path. The attacker can then call Vitest's CDP RPC and use Chrome's download controls to overwrite vite.config.ts in the project root. When Vitest reloads the changed config, attacker-controlled Node.js code executes on the host running Vitest.

The same exposed CDP bridge also allows direct browser-session JavaScript execution through Runtime.evaluate. A separate local probe showed that CDP can navigate the browser to a file:// URL and read rendered file contents, but the primary verified impact is config-file overwrite leading to RCE.

Reproduction

For a concrete reproduction, start Browser Mode in watch mode using the official Lit example:

sh
pnpm dlx tiged vitest-dev/vitest/examples/lit vitest-poc
cd vitest-poc
pnpm install

Configure the Browser Mode API to listen on all interfaces while explicitly disabling write and exec operations:

ts
import { playwright } from '@vitest/browser-playwright'
import { defineConfig } from 'vite'

export default defineConfig({
  test: {
    browser: {
      enabled: true,
      provider: playwright(),
      instances: [
        { browser: 'chromium' },
      ],
      api: {
        host: '0.0.0.0',
        allowWrite: false,
        allowExec: false,
      },
    },
  },
})

Then start the test server:

sh
pnpm test

Vitest serves the browser runner HTML and WebSocket API at http://localhost:63315.

While the browser session is active:

  1. Fetch the generated browser runner page:
text
   http://localhost:63315/__vitest_test__/
  1. Extract the embedded browser API token, active session id, project name, and project root:
  • window.VITEST_API_TOKEN
  • __vitest_browser_runner__.sessionId
  • __vitest_browser_runner__.config.name
  • __vitest_browser_runner__.config.root
  1. Connect to the browser API WebSocket as a tester client:
text
   /__vitest_browser_api__?type=tester&rpcId=<fresh-id>&sessionId=<session-id>&projectName=<project-name>&method=none&token=<token>
  1. Call the sendCdpEvent RPC method with:
text
   Page.setDownloadBehavior({
     behavior: "allow",
     downloadPath: __vitest_browser_runner__.config.root
   })
  1. Call sendCdpEvent again with Runtime.evaluate. The evaluated JavaScript creates a Blob containing a malicious Vite config and clicks an anchor element <a download="vite.config.ts">.
  2. Observed result:
  • vite.config.ts is overwritten with attacker-controlled content.
  • Vitest reloads the changed config.
  • The injected Node.js payload runs on the host.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 11 npm packages depend on vite-plus (9 direct, 2 indirect)

Ecosystem-wide dependent count for version 0.1.24.

Executive ViewAI

Why It Matters

Vitest Browser Mode (@vitest/browser versions 3.0.0-5.0.0-beta.3) contains a critical remote code execution vulnerability allowing unauthenticated attackers to execute arbitrary code on developer systems and build infrastructure. Organizations using Vitest with network-exposed browser APIs risk complete compromise of development environments and potential supply chain attacks through injection of malicious code into project configurations.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Restrict @vitest/browser API server binding exclusively to localhost (127.0.0.1) or Unix domain sockets-never expose to 0.0.0.0 or routable network interfaces; (2) Disable Browser Mode if testing strategy permits; (3) Run Vitest Browser Mode exclusively on isolated, airgapped development systems without network connectivity to untrusted networks; (4) Implement file integrity monitoring on vite.config.ts and enhanced process execution logging across all systems running affected Vitest versions; (5) Deploy network segmentation isolating all build infrastructure from external and general corporate networks; (6) Conduct comprehensive software composition analysis across all development and CI systems to identify complete Vitest deployment inventory.

Threat Intelligence Overview

EPSS Score
0.6%
Top 56% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

CVE-2025-68613 HIGH POC
8.8 Dec 19

Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation

CVE-2024-41713 CRITICAL POC
9.1 Oct 21

A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could

CVE-2024-55591 CRITICAL POC
9.8 Jan 14

FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2014-7205 CRITICAL POC
10.0 Oct 08

Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t

CVE-2025-59528 CRITICAL POC
10.0 Sep 22

Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete

CVE-2017-14849 HIGH POC
7.5 Sep 28

Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc

CVE-2017-5941 CRITICAL POC
9.8 Feb 09

An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2014-3744 HIGH POC
7.5 Oct 23

Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi

CVE-2014-9566 HIGH POC
7.5 Mar 10

Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin

CVE-2024-35286 CRITICAL POC
9.8 Oct 21

A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy