Skip to content
Memory corruption Advisory Advanced CVE-2026-6299

Use after free in Prerender (CVE-2026-6299)

A use-after-free occurs in Chrome's browsing data remover when a Clear-Site-Data header triggers cancellation of a new-tab prerender, freeing a WebContents object that the same loop later dereferences. An attacker could potentially reclaim the freed memory to hijack a virtual call and achieve remote code execution in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 19 days

Project Fortify, an experimental security project, has identified the following potential security issue.

Summary

BrowsingDataRemoverImpl::RemoveImpl (content/browser/browsing_data/browsing_data_remover_impl.cc:609-620) materializes a std::vector<WebContentsImpl*> snapshot of raw pointers via WebContentsImpl::GetAllWebContents() and iterates it with a range-for. For each entry it calls GetPrerenderHostRegistry()->CancelHostsByOriginFilter(). The snapshot includes both (a) the initiator tab's WebContents and (b) any WebContentsImpl owned by PrerenderNewTabHandle (created via WebContents::Create() in prerender_new_tab_handle.cc:44, with a primary RVH that passes the IsMainFrameActive() filter in GetRenderWidgetHosts()).

When the loop reaches the INITIATOR WebContents first (iteration order is non-deterministic — absl::flat_hash_map keyed by (process_id, routing_id) at render_widget_host_impl.cc:185-188), CancelHostsByOriginFilter (prerender_host_registry.cc:2006-2034) collects the new-tab handle's ID from prerender_new_tab_handle_by_id_ and calls CancelHosts(). CancelHosts (line 966-990) synchronously invokes CancelNewTabHostInternal (line 979).

CancelNewTabHostInternal (lines 1100-1127) moves the unique_ptr<PrerenderNewTabHandle> into a local variable 'handle' (line 1113). Because the final_status is kBrowsingDataRemoved (not kSpeculationRuleRemoved), execution takes the else branch (line 1122-1124): it calls handle->CancelPrerendering() which only parks the PrerenderHost for async deletion in the new-tab registry's to_be_deleted_hosts_ — it does NOT transfer ownership of the handle anywhere. When the function returns, the local 'handle' goes out of scope, invoking ~PrerenderNewTabHandle() (prerender_new_tab_handle.cc:62-66). The destructor body only nulls the delegate, but the member std::unique_ptr<WebContentsImpl> web_contents_ (prerender_new_tab_handle.h:90) is then destroyed, synchronously running ~WebContentsImpl().

Control returns to the outer range-for in browsing_data_remover_impl.cc. The next iteration dereferences the now-dangling WebContentsImpl* from the snapshot vector at line 612: web_contents->GetBrowserContext(). GetBrowserContext() is pure virtual (content/public/browser/web_contents.h:458), so this is a vtable read from freed memory. With heap grooming to reclaim the freed WebContentsImpl allocation, an attacker controls the vtable pointer → arbitrary virtual call → browser-process RCE.

MiraclePtr does NOT protect this: the snapshot is std::vector<WebContentsImpl*> using raw T* (web_contents_impl.cc:1599, web_contents_impl.h:229), not raw_ptr<T>, and the loop variable is a stack-local raw pointer.

The trigger is fully web-accessible with no user interaction: (1) attacker page at origin A inserts a speculation-rules script with target_hint:"_blank" to spawn a new-tab prerender via CreateAndStartHostForNewTab (prerender_host_registry.cc:859-889); (2) attacker serves a subresource or navigation response with Clear-Site-Data: "prerenderCache" (feature kClearSiteDataPrefetchPrerenderCache is FEATURE_ENABLED_BY_DEFAULT at third_party/blink/common/features.cc:392-393) OR the standard Clear-Site-Data: "cache" header (both satisfy the DATA_TYPE_PRERENDER_CACHE | DATA_TYPE_CACHE mask at line 609). The origin filter matches because initiator_origin is the attacker's origin (checked at prerender_host_registry.cc:2021-2025). Iteration-order dependence gives ~50% success per attempt; attacker can retry, or spawn multiple new-tab prerenders so that at least one freed pointer appears after the initiator in iteration order with high probability.

Location

content/browser/browsing_data/browsing_data_remover_impl.cc:609-620

Steps to Reproduce / Trigger Condition

  1. Serve an attacker-controlled page at https://attacker.example/index.html.
  2. The page inserts a <script type="speculationrules"> with a prerender rule using target_hint: "blank" pointing to https://attacker.example/prerender-target.html with eagerness: "immediate". This causes PrerenderHostRegistry::CreateAndStartHostForNewTab to be invoked on the initiator's registry, which constructs a PrerenderNewTabHandle owning a fresh WebContentsImpl and stores it in prerender_new_tab_handle_by_id.
  3. Wait briefly for the new-tab prerender WebContents to be created (its primary RVH is registered in g_routing_id_widget_map with is_active()==true).
  4. The page issues fetch('https://attacker.example/trigger', {credentials:'include'}) where /trigger responds with header Clear-Site-Data: "prerenderCache" (or "cache"). This invokes ClearSiteDataHandler → SiteDataClearer → BrowsingDataRemoverImpl::RemoveImpl on the UI thread with DATA_TYPE_PRERENDER_CACHE set.
  5. At browsing_data_remover_impl.cc:611, GetAllWebContents() returns a raw-pointer snapshot including both the initiator tab and the new-tab-prerender WebContents.
  6. If hash-map iteration processes the initiator first: CancelHostsByOriginFilter on the initiator's registry finds the handle (initiator_origin matches attacker.example), calls CancelHosts → CancelNewTabHostInternal, which moves the handle to a local unique_ptr and, for kBrowsingDataRemoved, takes the else branch. The local handle goes out of scope → ~PrerenderNewTabHandle → ~WebContentsImpl runs synchronously.
  7. The outer loop advances to the (now-freed) new-tab WebContentsImpl* and calls web_contents->GetBrowserContext() — a virtual call through a freed object's vtable pointer. ASAN reports heap-use-after-free.
  8. For exploitation: between the free and the dereference, groom the heap (e.g., via large ArrayBuffer/Blob allocations from another renderer, or by racing Mojo messages that allocate browser-process objects of similar size to WebContentsImpl) to reclaim the freed slot with attacker-controlled bytes. The first 8 bytes become the vtable pointer; the GetBrowserContext vtable-slot offset determines the hijacked call target.
  9. If iteration order is unfavorable, repeat steps 2-4 (remove/re-insert speculation rules and re-trigger Clear-Site-Data); expected success within a few attempts. Spawning multiple _blank prerenders (within the per-origin limit) increases per-attempt success probability since any one of several freed pointers appearing after the initiator suffices.

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

The browsing data remover iterates a snapshot of raw WebContentsImpl pointers, and cancelling a new-tab prerender synchronously destroys one of those WebContentsImpl objects, leaving a dangling pointer in the snapshot.

Impact

An attacker could potentially achieve browser-process remote code execution, though success depends on heap grooming and on favourable iteration order, giving roughly 50% success per attempt.

What the attacker needed

Victim visits attacker page; no user interaction needed; heap grooming for exploitation

How it was found

  1. Serve an attacker page that inserts a speculation-rules script with a _blank prerender target.
  2. Wait for the new-tab prerender WebContents to be created.
  3. Have the page fetch a URL that responds with a Clear-Site-Data header for the prerender cache.
  4. The browsing data remover snapshots all WebContents and begins iterating.
  5. If the initiator is processed first, cancelling the prerender frees the new-tab WebContents.
  6. The loop then dereferences the freed pointer, which ASAN reports as heap-use-after-free.

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 asks the browser to clear stored data, the browser loops over all open tabs and cancels any prerendered pages. A prerendered page is one the browser quietly loads in advance. In this bug, cancelling one of those pages destroys an object, but the loop still holds a pointer to it and uses it afterwards. Using memory after it has been freed can let an attacker who controls the freed memory redirect the program to code of their choosing.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.