blob: 2eacaa3eafbf97b9cc1d6c47525478ba438de7dc [file] [view] [edit]
# Chrome DevTools Frontend Security Policy & Threat Model
This document outlines the security goals, boundaries, and threat model for the Chrome DevTools frontend.
## Architectural Philosophy & Trust Boundaries
Chrome DevTools is a privileged web app running in a sandboxed renderer process, communicating via the Chrome DevTools Protocol (CDP).
* **Intended Capabilities:** DevTools is designed to inspect, mutate, and control debug targets (tabs, workers, remote nodes). Actions like code execution (Console, Snippets) or filesystem binding are intended behaviors, not vulnerabilities.
* **Data Processing:** The frontend does not execute untrusted user-space code in its own processes. It may instruct the debug target to execute code. It parses structured data from the CDP target. While a target page may be compromised, DevTools must safely display this data without escalating privileges to the browser process or host OS.
## Threat Model Boundaries
### Inside Threat Model
* Compromising the DevTools frontend renderer process.
* Compromising the CDP backend via tampered protocol messages.
* Unauthorized exfiltration of sensitive local files or user data outside the debugging scope.
* Triggering Chrome memory corruption exploits.
### Outside Threat Model
* **Social Engineering:** Convincing developers to paste payloads into the Console, download and open a compromised file, or connect to malicious remote debugging ports, etc.
* **Legitimate Data Exposure:** Displaying local user data, cookies, tokens, or auth headers within UI panels.
* **Local Data Persistence:** Saving user-initiated traces, heaps, profiles, or logs to disk.
* **Correctness & Availability:** Stale, misleading, or missing UI information (classified as functional bugs).
* **Denial of Service:** Chrome extensions or debug targets that disrupt DevTools' availability, e.g. through performance degradation.
* **Disabled-by-default Experimental Features:** Experimental features or capabilities that are disabled by default, e.g. requiring a command-line flag to be activated, or a specific runtime setting within DevTools to be manually turned on.
## Specific Severity Classification Rules (S1–S4)
### S0 (Critical)
* Exploits affecting users without Chrome DevTools being open.
### S1 (High)
* Exploits requiring only standard user actions within an open DevTools window.
* HTML injection or rendering untrusted content within the DevTools UI.
* Persistent exploits (e.g., manipulating service worker source code).
### S2 (Medium)
* Exploits strictly dependent on explicit, non-standard user interactions.
* Targets leveraging parsing flaws to compromise another renderer process without escaping the browser sandbox.
### S3 (Low)
* Exploits requiring a malicious, highly-privileged Chrome Extension to interact with DevTools APIs, including bypassing extension host policy.
* **Clarification (2026-11):** Per Chromium's [Severity Guidelines](https://chromium.googlesource.com/chromium/src/+/main/docs/security/severity-guidelines.md#TOC-Low-severity), this includes extensions holding the `debugger` permission (`chrome.debugger`) as well as `chrome.devtools.*` extensions.
* Vulnerabilities that assume an already-established untrusted CDP session (rather than an untrusted web page attacking an open DevTools window with standard user interaction), per Chromium's [Severity Guidelines](https://chromium.googlesource.com/chromium/src/+/main/docs/security/severity-guidelines.md#TOC-Low-severity).
* Spoofing links in DevTools that navigate to restricted internal URLs (e.g., `chrome://`).
* Vulnerabilities requiring specific command-line arguments, third-party tools, or loading tampered local files.
* Other exploits in features which are marked as experimental, but enabled by default.
## Specific Aspects
### AI & LLM Features
* **Trusted Backend:** The remote Google LLM backend is trusted; data sent to it is not an exfiltration vulnerability.
* **AI Safety:** Prompt injection, jailbreaks, or offensive/incorrect AI output are functional bugs, not vulnerabilities.
* **Exception:** Prompt injection is only a vulnerability if it crosses cross-origin boundaries or executes unauthorized CDP commands.
### Side-Effect Free Evaluation
* Side-effect free JavaScript evaluation is a best-effort developer heuristic to prevent accidental state changes, not a security boundary. Bypassing it to cause side effects on the debugged page is not a vulnerability.
### Self-XSS Paste Gate
* The self-XSS paste gate is not a security boundary. It is supposed to reduce the chance for abuse, not to fully prevent it. Issues around bypassing it are social engineering, and outside of our threat model.
### DevToolsUIBindings::LoadNetworkResource
* `DevToolsUIBindings::LoadNetworkResource` is a binding exposed to the Chrome DevTools web app. DevTools uses it to load resources such as source maps when loading through the CDP target is not possible.
* `DevToolsUIBindings::LoadNetworkResource` does not enforce Local Network Access checks on the requests because the resource content is not exposed to the inspected page and loading local source maps is a valid use case. Requests to local network endpoints triggered through this binding when DevTools is open are intended behavior and outside of our threat model.
### Recorder Extensions
* Passing a recording to a Recorder extension does not grant new access to the sites mentioned in the recording via DevTools or Chrome. DevTools disables Recorder extensions when an extension has a `runtime_blocked_hosts` policy, but it does not track origin provenance for recordings.
* Persisted converter preferences (such as the preferred copy format) can automatically pass recordings to a registered Recorder extension when viewing code or copying. DevTools does not require selecting the extension for each recording.
* Recordings can contain URLs, selectors, keystrokes, and cleartext form values captured on or referencing origins an extension cannot inspect. Examples include `chrome://`, the Chrome Web Store, other `chrome-extension://` pages, and `file://` without file access. Passing these recordings to a Recorder extension is intended behavior and outside our threat model.
## Local Non-Bugs & Working-As-Intended Patterns
This section adds to [Security for Agents](https://chromium.googlesource.com/chromium/src/+/main/docs/security/security-for-agents.md) and the [CDP Security Framework](https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/public/devtools_protocol/SECURITY.md). Absence from this list does not mean a finding is out of scope.
### MCP and AI Data Formatting
* AI Assistance and MCP formatters turn untrusted page data into plain text, Markdown, or JSON for an LLM. They are not HTML rendering sinks.
* Page-controlled strings breaking Markdown fences or spoofing section headers are functional bugs or prompt injection, not security vulnerabilities. This includes strings such as `document.title`, console messages, accessibility properties, heap snapshot names, trace summaries, and `JSON.stringify` output.
* Still in scope: HTML injection in the `devtools://` UI, cross-origin leaks that bypass origin locks or `NetworkRequestAccess`, and unauthorized CDP commands.
### Source-Map and Debug-Resource Fetching
* DevTools and local MCP tools fetch source maps (`sourceMappingURL`) and debug subresources through `PageResourceLoader` and `Host.ResourceLoader`.
* Requests to `localhost`, private RFC1918 networks, or local files are intended developer behavior when DevTools is open or when allowed by local `chrome-devtools-mcp` tooling. Response bodies stay in the DevTools client or MCP tool and are not exposed to the inspected page.
* `InspectorFrontendHostStub.loadNetworkResource` is only a fallback stub for non-embedded hosted mode and tests. Production Chrome uses `DevToolsUIBindings::LoadNetworkResource`, and `chrome-devtools-mcp` provides its own host implementation.
* Still in scope: inspected pages reading fetched responses across origins, bypassing page CSP on target-side loads, or unauthorized host file reads from an untrusted remote `devtools://` frontend.
### Developer Editing Surfaces vs. Self-XSS Paste Gate
* Watch expressions, conditional and logpoint breakpoints, Console `CommandLineAPI` helpers, inline DOM or attribute editing, and `Edit as HTML` are explicit tools for editing the DOM or running code in the target page.
* Missing or bypassed self-XSS paste warnings on these surfaces—or stashing `CommandLineAPI` helpers during Console evaluation—are social engineering outside the threat model.
* Still in scope: an untrusted page running code in the `devtools://` renderer or triggering target code execution without developer action.
### `chrome.debugger` Extensions and Attached CDP Sessions
* Trusted CDP clients (such as bundled DevTools or `--remote-debugging-*`) have full inspection and control within their attached target and `StoragePartition`. Extensions with the `debugger` permission (`chrome.debugger`) are restricted, untrusted CDP clients limited to an explicit domain allowlist on their attached target.
* Within those allowlisted domains, reading subresource bodies and `Performance.getMetrics`, observing `BackgroundService` events, configuring `WebAuthn` virtual authenticators, and sending synthetic input are intended capabilities (see the [Extensions Security FAQ](https://chromium.googlesource.com/chromium/src/+/main/extensions/docs/security_faq.md#What-privileges-does-the-Debugger-permission-grant-an-extension_What-privileges-should-it-lack)).
* Severity for malicious extensions and established untrusted CDP sessions follows `### S3 (Low)` above. Still in scope: invoking trusted-only CDP domains or unsafe operations from an untrusted client, escaping the attached `StoragePartition` or `Profile`, attaching to disallowed targets, or accessing unauthorized host files.
### WebSocket Transport (`?ws=` / `?wss=`) and User-Imported Files
* `createMainTransport` (`front_end/core/sdk/Connections.ts`) checks `?ws=` and `?wss=` before falling back to `MainConnection` so UI DevTools and standalone `devtools://` WebSocket debugging work.
* Web pages cannot navigate to `devtools://` without an existing privileged-navigation bug, and opening `devtools://` in a normal tab does not attach a debug target to `DevToolsUIBindings`.
* Tricking a user into opening a `devtools://...?ws=` URL for an untrusted server—or downloading and importing crafted traces, heap snapshots, heap profiles, or HAR files—is social engineering outside the threat model.
* Still in scope: imported files or remote protocol payloads that cause HTML injection in `devtools://`, run dangerous schemes like `javascript:`, or compromise the DevTools renderer.
## Further Documentation
* [Security for Agents](https://chromium.googlesource.com/chromium/src/+/main/docs/security/security-for-agents.md): Canonical Chromium guide on process boundaries, bug classification, reproduction requirements, and universal non-bugs.
* [Chrome Browser DevTools Host Bindings Security Policy](https://chromium.googlesource.com/chromium/src/+/main/chrome/browser/devtools/SECURITY.md): Browser-process security contract for `DevToolsUIBindings` and host-to-frontend boundaries.
* [DevTools MCP Entrypoint Security](mcp/SECURITY.md): Self-contained security delta for `mcp/`.
* [DevTools AI Assistance Security](front_end/models/ai_assistance/SECURITY.md): Self-contained security delta for `front_end/models/ai_assistance/`.