Skip to content
RCE Advisory Advanced CVE-2026-17751

Inappropriate implementation in AdFilter (CVE-2026-17751)

Blink's AdTracker uses a V8 API that skips a callback enforcing the ScriptForbiddenScope, allowing a malicious getter to run JavaScript during DOM insertion. This can corrupt the DOM tree and potentially lead to a use-after-free and renderer RCE.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 4 months

Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team.

Overview: Blink's AdTracker::GetApiFunctionInfo relies on v8::Object::Get to traverse properties when checking for monkey-patched APIs during DOM insertion. This V8 API intentionally skips the BeforeCallEnteredCallback, bypassing Blink's ScriptForbiddenScope checks. An attacker can exploit this using a malicious getter to execute synchronous JavaScript and mutate the DOM tree mid-insertion, leading to state corruption and potential renderer RCE.

Affected files:

  • third_party/blink/renderer/core/ad_tracker/ad_tracker.cc
  • third_party/blink/renderer/core/html/media/html_video_element.cc
  • third_party/blink/renderer/core/dom/container_node.cc
  • third_party/blink/renderer/core/html/html_frame_element_base.cc

Estimated timestamp from git blame: 2025-10-28

Background

During DOM tree mutations (e.g., ContainerNode::AppendChild), Blink instantiates a ScriptForbiddenScope and an EventDispatchForbiddenScope to prevent synchronous JavaScript execution. This guarantees that C++ DOM manipulation algorithms and iterators can operate safely without the tree being modified from underneath them.

The Vulnerability

When a <video> element is inserted into the DOM by an ad script, its InsertedInto lifecycle method calls AdTracker::IsAdScriptInStack. To prevent false positives from benign monkey-patching, AdTracker calls GetApiFunctionInfo to verify if standard APIs (like Node.prototype.appendChild) have been tampered with.

GetApiFunctionInfo walks the global object properties using v8::Object::Get(context, property_key). However, v8::Object::Get invokes PrepareForExecutionScope with the template parameter do_callback = false (defined in v8/src/api/api-inl.h).

Because do_callback is false, V8 skips calling isolate_->FireBeforeCallEnteredCallback(). Blink relies entirely on this callback (implemented in V8PerIsolateData::BeforeCallEnteredCallback) to enforce CHECK(!ScriptForbiddenScope::IsScriptForbidden()). Consequently, if an attacker places a JavaScript getter or Proxy on the property path (e.g., window.Node), it will execute synchronously inside V8 while the C++ stack is in the middle of a forbidden scope.

Impact

Bypassing ScriptForbiddenScope during DOM mutation algorithms is a critical violation of Blink's memory safety invariants. It enables classic DOM mutation reentrancy. An attacker can mutate the tree mid-iteration (e.g., reparenting nodes, creating circular sibling pointers), which leads to Detached Tree Use-After-Free (UAF) and potential Arbitrary Code Execution (RCE) within the sandboxed renderer process.

Potential Reproduction Steps

Note: These steps are generated based on static code analysis by an AI tooling agent and represent a theoretical attack path. A working proof-of-concept has not yet been executed.

  1. An attacker serves a script classified by Blink as an ad script (e.g., via a known ad domain).

  2. The ad script defines a malicious getter on window.Node:

    JavaScript
    Object.defineProperty(window, 'Node', {
      configurable: true,
      get() {
        // Executes during ScriptForbiddenScope!
        document.body.appendChild(iframe);
        return originalNode;
      }
    });
    
  3. The ad script constructs a DocumentFragment containing a <video> and the <iframe> element.

  4. The script appends the fragment to the DOM: document.body.appendChild(fragment).

  5. During ContainerNode::InsertNodeVector, the <video> element is processed first. Its InsertedInto method triggers AdTracker, which evaluates window.Node.

  6. The getter fires, synchronously appending the <iframe>. This links the <iframe> into the tree and triggers its InsertedInto lifecycle, initializing its frame.

  7. Control returns to the outer InsertNodeVector loop, which then processes the <iframe> a second time. Because the <iframe> was already appended during the getter, applying the insertion logic again creates a circular sibling pointer (lastChild()->SetNextSibling(&child)) and triggers a SECURITY_CHECK(!ContentFrame()) crash in HTMLFrameElementBase::InsertedInto.

Proposed Fix

There are several ways to address this issue:

  1. Use safe V8 accessors: Refactor AdTracker::GetApiFunctionInfo to avoid triggering author JavaScript. Instead of v8::Object::Get, use v8::Object::GetRealNamedProperty or retrieve the property descriptor to ensure only the native, non-getter value is inspected.
  2. Early exit: Check ScriptForbiddenScope::IsScriptForbidden() explicitly at the top of AdTracker::GetApiFunctionInfo or IsAdScriptInStackHelper, and gracefully return early (e.g., assuming it is not a monkey patch) if script execution is currently forbidden.

Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b


Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

The original report as published on the Chromium issue tracker. 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, AdTracker uses a V8 property access method that does not trigger the callback which enforces ScriptForbiddenScope, so a getter can execute JavaScript during a forbidden scope.

Impact

Bypassing ScriptForbiddenScope could lead to a detached tree use-after-free and potential arbitrary code execution within the sandboxed renderer process, though a working proof-of-concept has not been executed.

What the attacker needed

Victim visits a page with an ad script; attacker controls ad script content

The fix

The report proposes using safe V8 accessors that do not trigger author JavaScript, or checking ScriptForbiddenScope explicitly and returning early.

How it was found

  1. An attacker serves a script classified by Blink as an ad script.
  2. The ad script defines a malicious getter on window.Node.
  3. The ad script constructs a DocumentFragment containing a video and an iframe.
  4. The script appends the fragment to the DOM.
  5. During insertion, the video element triggers AdTracker, which evaluates window.Node and fires the getter.
  6. The getter appends the iframe, causing it to be processed again and leading to a crash.

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.

When a web page changes its structure, the browser normally blocks JavaScript from running at the same time to keep things safe. This report says a specific ad-detection feature accidentally allows JavaScript to run during that blocked period. That could let an attacker mess up the browser's internal state and possibly take over the part of the browser that runs the page.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.