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.
Reproduction
For a concrete reproduction, start Browser Mode in watch mode using the official Lit example:
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:
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:
pnpm test
Vitest serves the browser runner HTML and WebSocket API at http://localhost:63315.
While the browser session is active:
Fetch the generated browser runner page:
http://localhost:63315/__vitest_test__/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
Connect to the browser API WebSocket as a tester client:
/__vitest_browser_api__?type=tester&rpcId=<fresh-id>&sessionId=<session-id>&projectName=<project-name>&method=none&token=<token>Call the
sendCdpEventRPC method with:Page.setDownloadBehavior({ behavior: "allow", downloadPath: __vitest_browser_runner__.config.root })Call
sendCdpEventagain withRuntime.evaluate. The evaluated JavaScript creates a Blob containing a malicious Vite config and clicks an anchor element<a download="vite.config.ts">.Observed result:
vite.config.tsis overwritten with attacker-controlled content.- Vitest reloads the changed config.
- The injected Node.js payload runs on the host.
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.
The application does not perform an authorization check before performing a sensitive operation. Typical impact: unauthorized access to restricted functionality or data.
CVE-2026-53633 has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (5.0.0-beta.4, 4.1.8, 3.2.5, 0.1.24); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
@vitest/browser to 5.0.0-beta.4 or later; @vitest/browser to 4.1.8 or later; @vitest/browser to 3.2.5 or later; vite-plus to 0.1.24 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-53633? CVE-2026-53633 is a critical-severity missing authorization vulnerability in @vitest/browser (npm), affecting versions >= 5.0.0-beta.0, <= 5.0.0-beta.3. It is fixed in 5.0.0-beta.4, 4.1.8, 3.2.5, 0.1.24. The application does not perform an authorization check before performing a sensitive operation.
- How severe is CVE-2026-53633? CVE-2026-53633 has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2026-53633?
@vitest/browser(npm) (versions >= 5.0.0-beta.0, <= 5.0.0-beta.3)vite-plus(npm) (versions <= 0.1.23)
- Is there a fix for CVE-2026-53633? Yes. CVE-2026-53633 is fixed in 5.0.0-beta.4, 4.1.8, 3.2.5, 0.1.24. Upgrade to this version or later.
- Is CVE-2026-53633 exploitable, and should I be worried? Whether CVE-2026-53633 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-53633 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-53633?
- Upgrade
@vitest/browserto 5.0.0-beta.4 or later - Upgrade
@vitest/browserto 4.1.8 or later - Upgrade
@vitest/browserto 3.2.5 or later - Upgrade
vite-plusto 0.1.24 or later
- Upgrade