/

CVE-2026-53633

Severity:

CRITICAL RISK

(9.8)

Overly Permissive CDP API (CWE-749) in Vitest Browser

CVE-2026-53633

Awaiting Analysis

Vulnerability type

Category:

Overly Permissive Access Control

CWE:

CWE-749, CWE-862

Impact:

Remote Code Execution in Test Environment

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Vitest Browser Mode exposed a Chrome DevTools Protocol API that forwarded powerful debug commands without enforcing the intended write and execute permissions.

A remote client with access to the browser API metadata could use these CDP methods to overwrite vite.config.ts and run attacker-controlled Node.js code during tests.

Affected context

This vulnerability appears in Vitest deployments using Browser Mode where the cdp() API is reachable by remote clients, such as interactive test dashboards or automation tools.

Risk increases when browser debugging endpoints or API metadata are exposed over the network, especially if they lack strict authentication or authorization.

In these contexts, CDP methods like Page.setDownloadBehavior and Runtime.evaluate can be invoked from outside the trusted test runner, turning a debugging surface into a code execution vector.

Exploit preconditions

  • Attack surface: Vitest Browser Mode's cdp() API and any exposed browser debugging endpoint.
  • Required access: Ability to connect to the Vitest browser API or obtain exposed CDP metadata; this may be possible in shared CI systems, remote developer environments, or misconfigured tunnels.
  • Trigger point: Issuing Chrome DevTools Protocol commands (e.g., Page.setDownloadBehavior and Runtime.evaluate) through the unguarded cdp() interface.
  • Why exploitation is possible: The cdp() API forwarded raw CDP methods without enforcing allowWrite or allowExec gates, effectively granting write and execution capabilities to any client that could call the API.

Why this happens

The underlying bug is an authorization gap in a powerful debugging interface: an API intended for controlled browser inspection was exposed with overly permissive access.

By forwarding raw CDP methods without checking write or execution flags, Vitest created a situation where untrusted callers could perform state-changing and code-executing operations.

This maps to CWE-749: Exposed Dangerous Method or Function, because sensitive CDP capabilities were made accessible without proper restriction, and to CWE-862: Missing Authorization, as there was no effective permission check controlling who could invoke these methods.

Potential impact

  • Remote execution of arbitrary Node.js code in the test runner process.
  • Overwriting or corrupting project configuration files such as vite.config.ts.
  • Modification of test behavior to hide failures or implant malicious logic.
  • Lateral movement from a test environment into connected development or build systems.
  • Potential supply-chain impact if compromised tests or configs are committed and propagated.

General mitigation guidance

Effective mitigation focuses on tightening access control around debugging and browser integration APIs and reducing their default capabilities.

Common defensive patterns include:

  • Gating any write or execution-capable methods behind explicit authorization checks and feature flags.
  • Restricting exposed CDP or debug endpoints to localhost-only or trusted networks and requiring authentication for remote access.
  • Designing browser integration APIs with clear separation between read-only inspection operations and state-changing or execution operations.
  • Running test infrastructure with least privilege and isolating it from critical project files wherever practical.
  • Treating any remote-controllable debug or test interface as a potential execution channel and documenting its intended trust boundaries.

How teams detect issues like this

Organizations can surface similar issues by:

  • Applying static analysis and architectural reviews to identify APIs that forward or proxy powerful lower-level protocols (like CDP) without authorization checks.
  • Reviewing test and debug infrastructure for endpoints that expose file write or code execution capabilities, especially in browser automation or devtools integrations.
  • Enforcing security policies that require authentication and authorization for remote debug or test APIs, and verifying these controls in CI pipelines.
  • Using automated application security testing tools to scan for dangerous methods, such as dynamic evaluation, file writes, or configuration manipulation, behind externally reachable interfaces.

Sources

SourceLink
github.comgithub.com/vitest-dev/vitest/commit/385a1aefd4c2bfa5e7d58bf7c6834c929969f2c7
github.comgithub.com/vitest-dev/vitest/commit/63e3b2eee4d58da56786a6333f517b9b492528c7
github.comgithub.com/vitest-dev/vitest/commit/e4067b3b150005fd42cf75f994300119245806b9
github.comgithub.com/vitest-dev/vitest/pull/10444
github.comgithub.com/vitest-dev/vitest/pull/10450
github.comgithub.com/vitest-dev/vitest/pull/10456
github.comgithub.com/vitest-dev/vitest/releases/tag/v3.2.5
github.comgithub.com/vitest-dev/vitest/releases/tag/v4.1.8
github.comgithub.com/vitest-dev/vitest/releases/tag/v5.0.0-beta.4
github.comgithub.com/vitest-dev/vitest/security/advisories/GHSA-g8mr-85jm-7xhm

Frequently asked

questions

Not necessarily. While many Vitest Browser Mode deployments run locally, any configuration that exposes the browser API or CDP metadata over the network can make the issue remotely exploitable in shared environments or CI systems.

An attacker needs the ability to interact with the Vitest Browser Mode cdp() API or any endpoint that forwards CDP commands. If that interface is reachable without strong authentication, a remote client could trigger the exploit.

The safest pattern is to strictly gate dangerous methods—those that write files, change configuration, or execute code—behind explicit authorization checks and to avoid exposing raw protocol forwarding APIs to untrusted clients.

Teams can treat debug and test APIs as production-grade attack surfaces: design them with clear privilege boundaries, perform threat modeling on any remote control capability, enforce authentication and authorization, and include these interfaces in regular security code reviews and automated checks.

Find out what's already
exploitable in your codebase.