Use after free in Desktop (CVE-2026-110162)
SearchBox::FocusChanged dispatches provider JavaScript synchronously and then keeps using the SearchBox object, so a provider page can destroy its own render frame during that callback and leave the code reading and writing freed memory. On the shipped 32-bit build the stale callback could be steered to a Guard-CF target and a constrained chosen-DWORD write, though the author does not claim autonomous code execution or a sandbox escape.
- Fix shipped in 3 months
Report description
Renderer use-after-free in SearchBox::FocusChanged leading to an attacker-controlled 32-bit write
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://chromium.googlesource.com/chromium/src/+/main/chrome/renderer/searchbox/searchbox.cc
The problem
Please describe the technical details of the vulnerability
Renderer use-after-free in SearchBox::FocusChanged leading to an attacker-controlled 32-bit write
Summary
SearchBox::FocusChanged() dispatches the onkeycapturechange event to a
remote New Tab Page and then continues to access this. The event runs
provider-controlled JavaScript synchronously. That script can start a
cross-process navigation and enter the print nested loop, allowing the
RenderFrame and its SearchBox observer to be destroyed before the event
dispatch returns.
Control then resumes in the freed SearchBox. The first invalid operation is
a one-byte read of is_focused_. If the focus value differs, the next
instruction writes one byte to the freed object.
I reproduced the UAF twice without a debugger in Google's official Windows
ASan build 152.0.7939.3. ASan reports:
ERROR: AddressSanitizer: heap-use-after-free
READ of size 1
SearchBox::FocusChanged
chrome/renderer/searchbox/searchbox.cc:290
MiraclePtr Status: NOT PROTECTED
This crash is still exploitable with MiraclePtr.
ASan stops at that first stale read. The attacker-controlled 32-bit write in
the title is a separate Stable x86 exploitability result measured below; it is
not inferred from the ASan READ of size 1 line.
I also reproduced the renderer access violation in Google Chrome Stable
150.0.7871.187. On the shipped x86 product, a diagnostic exploitability
harness progressed from the same stale callback to an attacker-selected
Guard-CF target and a constrained chosen-DWORD write. I do not claim an
autonomous RCE or a sandbox escape.
Affected surface
When a search provider is installed, selected as default, and supplies a
remote NTP, Chrome runs that NTP in an Instant renderer and exposes the
chrome.embeddedSearch.searchBox API. Any such provider can therefore reach
this code from its NTP document. This is the generic provider path;
PrivacyWall is only the provider used by the local PoC.
Once the NTP loads, the trigger is page-only: no click or keystroke inside the page is required. A malicious provider, or an attacker who can execute script in that provider's NTP document, can exercise the vulnerable callback.
Root cause
The vulnerable Stable source is
chrome/renderer/searchbox/searchbox.cc:268-296:
void SearchBox::FocusChanged(OmniboxFocusState new_focus_state,
OmniboxFocusChangeReason reason) {
bool key_capture_enabled = new_focus_state == OMNIBOX_FOCUS_INVISIBLE;
if (key_capture_enabled != is_key_capture_enabled_) {
if (reason != OMNIBOX_FOCUS_CHANGE_TYPING) {
is_key_capture_enabled_ = key_capture_enabled;
if (can_run_js_in_renderframe_) {
SearchBoxExtension::DispatchKeyCaptureChange(
render_frame()->GetWebFrame());
}
}
}
bool is_focused = new_focus_state == OMNIBOX_FOCUS_VISIBLE;
if (is_focused != is_focused_) {
is_focused_ = is_focused;
if (can_run_js_in_renderframe_)
SearchBoxExtension::DispatchFocusChange(render_frame()->GetWebFrame());
}
}
DispatchKeyCaptureChange() calls provider JavaScript synchronously. During
that callback, the PoC:
- asks its Service Worker to navigate the current NTP cross-process;
- enters
window.print(), which runs a nested renderer loop; - lets the pending navigation commit inside that loop.
The commit destroys RenderFrameImpl, which destroys the observer and calls:
void SearchBox::OnDestruct() {
delete this;
}
The JavaScript dispatch then returns to the still-active
FocusChanged() frame. Line 289 reads state from the freed object; line 291
performs the conditional stale byte write.
SearchBox already contains a WeakPtrFactory, but this synchronous
JavaScript boundary does not use it.
Proof of concept
Attachments poc.html and server.py form a minimal loopback PoC. The Python
server serves the remote NTP, Service Worker, redirect, and cross-site target.
The local certificate and exact launch command are embedded in server.py.
The PoC crashes a vulnerable renderer. Use a disposable profile.
-
Start the server:
PowerShell python server.py -
Launch the target Chrome with this command, replacing only the executable and disposable profile paths:
PowerShell chrome.exe --user-data-dir="C:\fresh-searchbox-profile" --no-first-run --no-default-browser-check --host-resolver-rules="MAP www.privacywall.org:443 127.0.0.1:8443,MAP target.test 127.0.0.1,EXCLUDE localhost" --ignore-certificate-errors-spki-list=xkyrnR2Zb9SYwTCmi6GjkrYnkmiz76jwP4EA2WjSKW0=The host mapping and SPKI switch route the two test origins to loopback and trust only the PoC certificate. They do not disable the renderer sandbox or alter the memory allocator.
-
In that same disposable profile, select PrivacyWall as the default search provider through Chrome's normal settings UI.
-
Open
chrome://newtab/twice. The first tab installs and pins the Service Worker. The second tab verifiesembeddedSearchadmission and triggers automatically. -
Observe the renderer ASan report.
The PoC does not use CDP, MojoJS, --no-sandbox, --single-process, a patched
browser, or synthetic page input.
Expected page/server sequence:
[+] remote NTP load 1: pin
[+] remote NTP load 2: trigger
[page] PASS: embeddedSearch admitted
[page] TRIGGER: navigation + print nested loop
[+] cross-site navigation requested
[+] releasing cross-site navigation
The attached asan_uaf.log is a complete debugger-free report from the
official ASan product. Its deallocation stack contains
SearchBox::~SearchBox and RenderFrameImpl::~RenderFrameImpl; its allocation
stack contains ChromeContentRendererClient::RenderFrameCreated.
Stable x86 exploitability result
I tested the shipped 32-bit Stable product with the normal renderer sandbox and multiprocess model retained:
OS: Windows 11
Google Chrome: 150.0.7871.187
Chromium: 30f6543ae91e6a860e73b76e3216b663b050f4e5
chrome.exe: 13d12159484e2c156f7efd94af6e7a930e6915b483a767e7f28629976219a8c2
chrome.dll: bdfa15e550ab0e6ffaddd1f62ba76aede638bec0ddd37b430c44303a40469d83
PartitionAlloc's 32-bit freelist shadow allowed the stale pointer to resolve
into page-retained ArrayBuffer memory. The page shaped a fake object and
selected a valid entry from the product's Guard CF table. The selected native
target copied an independently selected DWORD to an independently selected
destination.
The measured transition was:
destination: 0x6b6b746b
before: 0x11223344
value: 0x41424344
after: 0x41424344
adjacent: 0x55667788 -> 0x00000000
The target also performs mandatory collateral mutations: it replaces one source pointer with the destination, decrements one counter, and clears two fake-object fields. The primitive is therefore a constrained chosen-DWORD write, not an unconstrained arbitrary write.
Attachment stable_x86_chosen_dword.log is the raw ordered CDB receipt. CDB
resolved the randomized module base and observed fixed product instructions;
it did not perform the selected write. Attachment
stable_x86_write_receipt.json records the independent page readback, the
collateral state, the complete native return, and the live renderer probe.
Impact and limits
An installed search provider selected as default and supplying a remote NTP can trigger a renderer heap-use-after-free without any further page interaction. The allocation is not protected by MiraclePtr. The Stable x86 result shows that the stale callback can progress beyond a crash to an attacker-selected CFG-valid native target and a constrained chosen-DWORD write, with page-visible readback and a complete native return.
The x86 diagnostic used CDB to resolve the randomized module base. It does not prove an in-product ASLR disclosure, an unconstrained arbitrary write, autonomous code execution, a sandbox escape, or the same exploitation primitive on x64.
Regression
The vulnerable continuation was introduced by commit
8d4c276d84f9612b25170183e92265aaa973625d
on 2013-05-29. That change merged key-capture and focus updates into one
handler, leaving the new is_focused_ access after the synchronous
DispatchKeyCaptureChange() callback.
The same unguarded sequence remains in main revision
d7c51995d79850bbb09f5e745478674352d9187d
checked on 2026-07-29.
Attachment bisection.md contains the introducing diff and source hashes.
Suggested fix
The invariant should be: after dispatching provider JavaScript, do not access
SearchBox members until a previously captured weak pointer proves that the
object survived.
if (can_run_js_in_renderframe_) {
base::WeakPtr<SearchBox> weak_this = weak_ptr_factory_.GetWeakPtr();
SearchBoxExtension::DispatchKeyCaptureChange(
render_frame()->GetWebFrame());
if (!weak_this) {
return;
}
}
Attachment proposed_fix.patch applies this guard. A regression test should
destroy the RenderFrame synchronously from the key-capture callback and
verify that FocusChanged() returns without reading the later focus state.
Impact analysis
When a search provider is installed, selected as default, and supplies a
remote New Tab Page, Chrome exposes the privileged SearchBox API to that
provider's page. The provider can destroy its renderer frame during the
synchronous onkeycapturechange callback without a page click or keystroke.
SearchBox::FocusChanged() then resumes and accesses the freed renderer
object. The official Windows ASan product reports a one-byte heap-use-after-free
read with MiraclePtr Status: NOT PROTECTED.
On Chrome Stable x86, a module-base-assisted diagnostic harness progressed from the stale callback to an attacker-selected Guard-CF target and a constrained chosen-DWORD write with documented collateral effects. The renderer sandbox remained enabled. I do not claim an autonomous RCE, arbitrary read, or sandbox escape.
The cause
What version of Chrome have you found the security issue in?
150.0.7871.187 Stable x86; UAF also reproduced in official Windows ASan 152.0.7939.3
Is the security issue related to a crash?
Yes, it is related to a crash.
Choose the type of vulnerability
Memory Corruption (in a sandboxed process)
How would you like to be publicly acknowledged for your report?
Findingz
Context
Chrome's SearchBox is the renderer-side object that backs the chrome.embeddedSearch.searchBox API. When a search provider is installed, selected as the default, and supplies a remote New Tab Page, Chrome runs that NTP in an Instant renderer and exposes the privileged SearchBox API to the provider's document. The provider's JavaScript can therefore interact with focus and key-capture state through callbacks such as onkeycapturechange.
The vulnerable code lives in chrome/renderer/searchbox/searchbox.cc. The report describes a use-after-free in SearchBox::FocusChanged(): the method dispatches provider JavaScript synchronously and then keeps using this, even though that JavaScript can destroy the RenderFrame and, with it, the SearchBox observer.
Setup
The researcher worked with two builds:
| Build | Purpose |
|---|---|
Google Chrome Stable 150.0.7871.187, x86 |
Renderer access violation and Stable exploitability work |
Official Windows ASan build 152.0.7939.3 |
Debugger-free heap-use-after-free reproduction |
The vulnerable Stable source revision is [redacted]. The PoC consists of two attachments, poc.html and server.py. The Python server serves the remote NTP, the Service Worker, the redirect and the cross-site target. The local certificate and the exact launch command are embedded in server.py.
The PoC uses PrivacyWall as the search provider, but the report is explicit that this is only the provider used locally; the path is generic to any provider that supplies a remote NTP.
Finding it
The problem is the ordering inside FocusChanged(). The method calls SearchBoxExtension::DispatchKeyCaptureChange(), which runs provider JavaScript synchronously. Only after that call returns does it read and write is_focused_. If the callback destroys the RenderFrame, the SearchBox observer is destroyed too, and the method continues on freed memory.
The researcher notes that SearchBox already contains a WeakPtrFactory, but this synchronous JavaScript boundary does not use it.
Exploitation
Step 1: understand the vulnerable code
The Stable source at chrome/renderer/searchbox/searchbox.cc:268-296 is:
void SearchBox::FocusChanged(OmniboxFocusState new_focus_state,
OmniboxFocusChangeReason reason) {
bool key_capture_enabled = new_focus_state == OMNIBOX_FOCUS_INVISIBLE;
if (key_capture_enabled != is_key_capture_enabled_) {
if (reason != OMNIBOX_FOCUS_CHANGE_TYPING) {
is_key_capture_enabled_ = key_capture_enabled;
if (can_run_js_in_renderframe_) {
SearchBoxExtension::DispatchKeyCaptureChange(
render_frame()->GetWebFrame());
}
}
}
bool is_focused = new_focus_state == OMNIBOX_FOCUS_VISIBLE;
if (is_focused != is_focused_) {
is_focused_ = is_focused;
if (can_run_js_in_renderframe_)
SearchBoxExtension::DispatchFocusChange(render_frame()->GetWebFrame());
}
}
DispatchKeyCaptureChange() calls provider JavaScript synchronously. Everything after that call, including the read of is_focused_ on line 289 and the conditional write on line 291, runs on an object the callback may already have freed.
Step 2: destroy the frame from inside the callback
During the onkeycapturechange callback, the PoC does three things:
- asks its Service Worker to navigate the current NTP cross-process;
- enters
window.print(), which runs a nested renderer loop; - lets the pending navigation commit inside that loop.
The commit destroys RenderFrameImpl, which destroys the observer and calls:
void SearchBox::OnDestruct() {
delete this;
}
The JavaScript dispatch then returns to the still-active FocusChanged() frame. Line 289 reads state from the freed object; line 291 performs the conditional stale byte write.
Step 3: run the PoC server
Start the server:
python server.py
Step 4: launch Chrome against the loopback origins
Launch the target Chrome with this command, replacing only the executable and disposable profile paths:
chrome.exe --user-data-dir="C:\fresh-searchbox-profile" --no-first-run --no-default-browser-check --host-resolver-rules="MAP www.privacywall.org:443 [redacted]:8443,MAP target.test [redacted],EXCLUDE localhost" --ignore-certificate-errors-spki-list=[redacted]=
The host mapping and SPKI switch route the two test origins to loopback and trust only the PoC certificate. They do not disable the renderer sandbox or alter the memory allocator.
Step 5: select the provider and trigger
- In that same disposable profile, select PrivacyWall as the default search provider through Chrome's normal settings UI.
- Open
chrome://newtab/twice. The first tab installs and pins the Service Worker. The second tab verifiesembeddedSearchadmission and triggers automatically. - Observe the renderer ASan report.
The PoC does not use CDP, MojoJS, --no-sandbox, --single-process, a patched browser, or synthetic page input. Once the NTP loads, the trigger is page-only: no click or keystroke inside the page is required.
The expected page and server sequence is:
[+] remote NTP load 1: pin
[+] remote NTP load 2: trigger
[page] PASS: embeddedSearch admitted
[page] TRIGGER: navigation + print nested loop
[+] cross-site navigation requested
[+] releasing cross-site navigation
Step 6: read the ASan result
The researcher reproduced the UAF twice without a debugger in the official Windows ASan build 152.0.7939.3. ASan reports:
ERROR: AddressSanitizer: heap-use-after-free
READ of size 1
SearchBox::FocusChanged
chrome/renderer/searchbox/searchbox.cc:290
MiraclePtr Status: NOT PROTECTED
This crash is still exploitable with MiraclePtr.
ASan stops at that first stale read. The report is careful to separate this from the 32-bit write in the title: the attacker-controlled 32-bit write is a separate Stable x86 exploitability result measured below, not inferred from the ASan READ of size 1 line.
The attached asan_uaf.log is a complete debugger-free report from the official ASan product. Its deallocation stack contains SearchBox::~SearchBox and RenderFrameImpl::~RenderFrameImpl; its allocation stack contains ChromeContentRendererClient::RenderFrameCreated.
Step 7: measure the Stable x86 primitive
The shipped 32-bit Stable product was tested with the normal renderer sandbox and multiprocess model retained:
OS: Windows 11
Google Chrome: 150.0.7871.187
Chromium: [redacted]
chrome.exe: [redacted]
chrome.dll: [redacted]
PartitionAlloc's 32-bit freelist shadow allowed the stale pointer to resolve into page-retained ArrayBuffer memory. The page shaped a fake object and selected a valid entry from the product's Guard CF table. The selected native target copied an independently selected DWORD to an independently selected destination.
The measured transition was:
destination: 0x6b6b746b
before: 0x11223344
value: 0x41424344
after: 0x41424344
adjacent: 0x55667788 -> 0x00000000
The target also performs mandatory collateral mutations: it replaces one source pointer with the destination, decrements one counter, and clears two fake-object fields. The primitive is therefore a constrained chosen-DWORD write, not an unconstrained arbitrary write.
Attachment stable_x86_chosen_dword.log is the raw ordered CDB receipt. CDB resolved the randomized module base and observed fixed product instructions; it did not perform the selected write. Attachment stable_x86_write_receipt.json records the independent page readback, the collateral state, the complete native return, and the live renderer probe.
Root cause
The vulnerable continuation was introduced by commit [redacted] on 2013-05-29. That change merged key-capture and focus updates into one handler, leaving the new is_focused_ access after the synchronous DispatchKeyCaptureChange() callback.
The same unguarded sequence remains in main revision [redacted], checked on 2026-07-29. Attachment bisection.md contains the introducing diff and source hashes.
The object already has a WeakPtrFactory, but the synchronous JavaScript boundary does not consult it. MiraclePtr does not protect the allocation: ASan reports MiraclePtr Status: NOT PROTECTED and states the crash is still exploitable with MiraclePtr.
Impact
An installed search provider selected as default and supplying a remote NTP can trigger a renderer heap-use-after-free without any further page interaction. The allocation is not protected by MiraclePtr.
The Stable x86 result shows that the stale callback can progress beyond a crash to an attacker-selected CFG-valid native target and a constrained chosen-DWORD write, with page-visible readback and a complete native return. The renderer sandbox remained enabled.
The researcher does not claim an autonomous RCE, an unconstrained arbitrary write, an arbitrary read, or a sandbox escape. The x86 diagnostic used CDB to resolve the randomised module base; it does not prove an in-product ASLR disclosure, autonomous code execution, or the same exploitation primitive on x64.
Fix
The suggested invariant is: after dispatching provider JavaScript, do not access SearchBox members until a previously captured weak pointer proves that the object survived.
if (can_run_js_in_renderframe_) {
base::WeakPtr<SearchBox> weak_this = weak_ptr_factory_.GetWeakPtr();
SearchBoxExtension::DispatchKeyCaptureChange(
render_frame()->GetWebFrame());
if (!weak_this) {
return;
}
}
Attachment proposed_fix.patch applies this guard. A regression test should destroy the RenderFrame synchronously from the key-capture callback and verify that FocusChanged() returns without reading the later focus state.
Variants to test
- Other synchronous dispatch points in SearchBox. Look for any other member access after a call that can run provider JavaScript. A positive result is a stale read or write in ASan after the callback destroys the frame.
- Other renderer observers with a
WeakPtrFactorythat is not used at a JS boundary. A positive result is a heap-use-after-free where the object is deleted fromOnDestruct()during a synchronous callback. - Nested-loop destruction paths. Try
window.print(), modal dialogs or other nested renderer loops that let a pending cross-process navigation commit while a callback is still on the stack. A positive result is the same deallocation stack containing the observer destructor andRenderFrameImpl::~RenderFrameImpl. - 32-bit PartitionAlloc freelist reuse. On x86 builds, check whether a freed observer slot can be resolved into page-retained
ArrayBuffermemory and shaped into a fake object. A positive result is a controlled readback at a chosen destination with the documented collateral mutations.
What happened, in plain words
Chrome lets a search provider (the company whose search engine your browser uses, for example when you type in the address bar) replace Chrome's built-in New Tab Page with its own web page. That page is called a remote NTP, short for New Tab Page. When you open a new tab, Chrome loads the provider's page instead of its own.
Because that page is trusted to talk to the browser in special ways, Chrome gives it access to a small set of privileged commands, called the SearchBox API. An API is simply a list of commands one program offers to another: think of a restaurant menu, where you can only order what is printed on it. The SearchBox API lets the provider's page react to things like the address bar gaining or losing focus, or the browser starting to capture keystrokes.
One of those commands is a callback, meaning a function the browser calls on the page when something happens. This one is called onkeycapturechange. The bug is that Chrome calls this page-supplied function in the middle of its own bookkeeping, and then carries on using an internal object that the page's function may already have caused to be deleted. Using memory after it has been freed is a well-known class of bug called a use-after-free, often shortened to UAF. The everyday comparison: you write a note on a piece of paper, throw the paper in the bin, and then keep reading from the bin, assuming the paper is still yours. Someone else may have taken it, or the bin may have been emptied, and whatever you read is no longer what you wrote.
In this case the freed object is called SearchBox. The report shows that a malicious search provider, or anyone who can run script inside that provider's New Tab Page, can trigger the bug with no click and no keystroke from the user. On the official diagnostic build of Chrome the bug shows up as a crash report from a tool called AddressSanitizer (ASan), which is a memory checker that shouts when a program touches memory it should not. On the normal 32-bit Stable build of Chrome, the researcher went further and showed that the stale access can be steered into a constrained chosen-DWORD write, with documented collateral effects. The researcher is careful not to claim full remote code execution or a way out of Chrome's sandbox.
Context
Chrome is split into processes. A process is an isolated running program; if one crashes or is compromised, the others keep going. The part that reads and displays web pages is the renderer. The part that manages windows, tabs and permissions is the browser process. The renderer is deliberately kept in a sandbox, a restricted environment that limits what it can touch on your computer.
Inside the renderer, Chrome keeps a C++ object called SearchBox. An object in programming is a bundle of data plus functions that operate on that data. SearchBox is the thing that backs the chrome.embeddedSearch.searchBox API, which is the menu of commands the provider's page can call. When a search provider is installed, chosen as the default, and supplies a remote New Tab Page, Chrome runs that page in a renderer dedicated to this feature (called an Instant renderer) and exposes the privileged SearchBox API to the page's document. A document here just means the web page itself, with its HTML and JavaScript.
Because the page has that API, its JavaScript can interact with focus and key-capture state through callbacks such as onkeycapturechange. Focus means which element on the page is currently receiving input; key capture means the browser is intercepting keystrokes for its own use, for example to fill the address bar.
The vulnerable code lives in a source file called chrome/renderer/searchbox/searchbox.cc. The report describes a use-after-free in a function called SearchBox::FocusChanged(). The function calls into the provider's JavaScript and waits for it to finish, then keeps using its own object (this, in C++ the keyword for the current object), even though that JavaScript may have destroyed the renderer frame and, along with it, the SearchBox observer. An observer is an object that registers itself to be told when something happens; here, SearchBox observes the renderer frame so it can react to focus changes.
Setup
The researcher worked with two builds:
| Build | Purpose |
|---|---|
Google Chrome Stable 150.0.7871.187, x86 |
Renderer access violation and Stable exploitability work |
Official Windows ASan build 152.0.7939.3 |
Debugger-free heap-use-after-free reproduction |
A build is a particular compiled version of the program. Stable is the normal release everyone installs. x86 means the 32-bit variant, as opposed to x64, the 64-bit variant. An access violation is the operating system's way of stopping a program that reads or writes memory it does not own. A debugger is a tool that lets a developer pause and inspect a running program; the researcher reproduced the bug without one, which makes the result stronger because it does not depend on special tooling.
The vulnerable Stable source revision is [redacted]. A revision is a unique identifier for one saved state of the source code, like a page number in a very long book. The proof of concept, or PoC, consists of two attachments, poc.html and server.py. A PoC is a small, deliberately harmless demonstration that proves a bug is real. The Python server serves the remote NTP, the Service Worker, the redirect and the cross-site target. A Service Worker is a script the browser keeps in the background for a website, able to intercept network requests and survive page reloads; think of a receptionist who handles requests even when the person at the desk has changed. A redirect is a server telling the browser to go somewhere else. A cross-site target is a page on a different origin, where an origin means the combination of scheme, host and port that the browser uses to decide what may talk to what.
The local certificate and the exact launch command are embedded in server.py. A certificate is the digital document a server presents to prove its identity when a browser connects over HTTPS, the encrypted version of the web.
The PoC uses PrivacyWall as the search provider, but the report is explicit that this is only the provider used locally; the path is generic to any provider that supplies a remote NTP.
Finding it
The problem is the ordering inside FocusChanged(). The method calls SearchBoxExtension::DispatchKeyCaptureChange(), which runs provider JavaScript synchronously. Synchronously means the caller waits for the called code to finish before continuing, like a phone call where you stay on the line until the other person hangs up. Only after that call returns does the method read and write is_focused_, a member variable that records whether the address bar is focused. If the callback destroys the RenderFrame, the SearchBox observer is destroyed too, and the method continues on freed memory.
The researcher notes that SearchBox already contains a WeakPtrFactory, but this synchronous JavaScript boundary does not use it. A weak pointer is a reference to an object that does not keep it alive and can tell you whether the object still exists; a WeakPtrFactory is the C++ helper that produces such pointers. Think of a weak pointer as a claim ticket for a coat: if the coat has already been collected, the ticket tells you so instead of handing you someone else's coat.
Exploitation
Step 1: understand the vulnerable code
The Stable source at chrome/renderer/searchbox/searchbox.cc:268-296 is:
void SearchBox::FocusChanged(OmniboxFocusState new_focus_state,
OmniboxFocusChangeReason reason) {
bool key_capture_enabled = new_focus_state == OMNIBOX_FOCUS_INVISIBLE;
if (key_capture_enabled != is_key_capture_enabled_) {
if (reason != OMNIBOX_FOCUS_CHANGE_TYPING) {
is_key_capture_enabled_ = key_capture_enabled;
if (can_run_js_in_renderframe_) {
SearchBoxExtension::DispatchKeyCaptureChange(
render_frame()->GetWebFrame());
}
}
}
bool is_focused = new_focus_state == OMNIBOX_FOCUS_VISIBLE;
if (is_focused != is_focused_) {
is_focused_ = is_focused;
if (can_run_js_in_renderframe_)
SearchBoxExtension::DispatchFocusChange(render_frame()->GetWebFrame());
}
}
Line by line, in plain words:
void SearchBox::FocusChanged(...)declares a function belonging toSearchBoxthat returns nothing. It receives two inputs: the new focus state and the reason for the change.bool key_capture_enabled = new_focus_state == OMNIBOX_FOCUS_INVISIBLE;works out whether key capture should now be on, by checking whether the address bar has become invisible.if (key_capture_enabled != is_key_capture_enabled_) {asks whether this differs from what the object currently remembers.if (reason != OMNIBOX_FOCUS_CHANGE_TYPING) {skips the update when the change was caused by typing.is_key_capture_enabled_ = key_capture_enabled;stores the new value.if (can_run_js_in_renderframe_) {checks that JavaScript is allowed to run in this renderer at all.SearchBoxExtension::DispatchKeyCaptureChange(render_frame()->GetWebFrame());is the dangerous line: it calls the provider'sonkeycapturechangeJavaScript and waits for it to finish.bool is_focused = new_focus_state == OMNIBOX_FOCUS_VISIBLE;works out whether the address bar is now focused.if (is_focused != is_focused_) {compares that with the stored value.is_focused_ = is_focused;writes the new value into the object. This is the write that lands on freed memory if the callback destroyed the object.if (can_run_js_in_renderframe_)checks again whether JavaScript may run.SearchBoxExtension::DispatchFocusChange(render_frame()->GetWebFrame());calls another provider callback,onfocuschange.
DispatchKeyCaptureChange() calls provider JavaScript synchronously. Everything after that call, including the read of is_focused_ on line 289 and the conditional write on line 291, runs on an object the callback may already have freed.
Step 2: destroy the frame from inside the callback
During the onkeycapturechange callback, the PoC does three things:
- asks its Service Worker to navigate the current NTP cross-process;
- enters
window.print(), which runs a nested renderer loop; - lets the pending navigation commit inside that loop.
A cross-process navigation means the browser moves the tab from one renderer process to another, for example because the new page belongs to a different site. window.print() is the JavaScript command that opens the print dialog; internally it runs a nested loop, meaning the renderer starts processing other pending work while the print dialog is open, like a cashier serving the next customer while your receipt prints. A navigation commits when the browser finally switches the tab to the new page. That commit destroys RenderFrameImpl, the renderer-side object representing the frame, which destroys the observer and calls:
void SearchBox::OnDestruct() {
delete this;
}
This tiny function is the destructor hook: when the observer is told it is being destroyed, it deletes itself. delete this; frees the object's memory.
The JavaScript dispatch then returns to the still-active FocusChanged() frame. Line 289 reads state from the freed object; line 291 performs the conditional stale byte write. Stale here means the value is read from memory that no longer belongs to the object.
Step 3: run the PoC server
Start the server:
python server.py
This runs the Python script that plays the part of the malicious search provider's web server on your own machine. It serves the New Tab Page, the Service Worker, the redirect and the cross-site target, so the whole scenario can be reproduced without touching the real internet.
Step 4: launch Chrome against the loopback origins
Launch the target Chrome with this command, replacing only the executable and disposable profile paths:
chrome.exe --user-data-dir="C:\fresh-searchbox-profile" --no-first-run --no-default-browser-check --host-resolver-rules="MAP www.privacywall.org:443 [redacted]:8443,MAP target.test [redacted],EXCLUDE localhost" --ignore-certificate-errors-spki-list=[redacted]=
What each part does:
chrome.exeis the browser program being started.--user-data-dir="C:\fresh-searchbox-profile"tells Chrome to use a separate, disposable profile folder, so the test does not touch your normal bookmarks, passwords or settings. A profile is the folder where Chrome keeps a user's data.--no-first-runand--no-default-browser-checkskip the usual first-launch prompts so the test starts cleanly.--host-resolver-rules="MAP www.privacywall.org:443 [redacted]:8443,MAP target.test [redacted],EXCLUDE localhost"rewrites where two test hostnames point.[redacted]is the loopback address, meaning this computer itself. So requests forwww.privacywall.orgon port 443 are sent to the local server on port 8443, and requests fortarget.testare sent to the local machine.EXCLUDE localhostleaves normal localhost lookups alone.--ignore-certificate-errors-spki-list=[redacted]=tells Chrome to trust the PoC's own certificate, identified by its SPKI fingerprint, a hash of the certificate's public key. Without this, Chrome would refuse the locally generated certificate.
The host mapping and SPKI switch route the two test origins to loopback and trust only the PoC certificate. They do not disable the renderer sandbox or alter the memory allocator. The memory allocator is the part of the program that hands out and reclaims memory; leaving it untouched means the test reflects real Chrome behaviour.
Step 5: select the provider and trigger
- In that same disposable profile, select PrivacyWall as the default search provider through Chrome's normal settings UI.
- Open
chrome://newtab/twice. The first tab installs and pins the Service Worker. The second tab verifiesembeddedSearchadmission and triggers automatically. - Observe the renderer ASan report.
chrome://newtab/ is Chrome's internal address for the New Tab Page. Opening it twice matters because the first load registers the Service Worker and keeps it alive (pinning it), while the second load is the one that runs the trigger. Admission here means the page is allowed to use the embeddedSearch API.
The PoC does not use CDP, MojoJS, --no-sandbox, --single-process, a patched browser, or synthetic page input. CDP, the Chrome DevTools Protocol, is a debugging interface; MojoJS is a way to reach Chrome's internal messaging from JavaScript; --no-sandbox and --single-process are switches that weaken Chrome's isolation. Avoiding all of them means the demonstration works on an ordinary, fully protected browser. Synthetic page input would mean faking clicks or keystrokes; the PoC needs none. Once the NTP loads, the trigger is page-only: no click or keystroke inside the page is required.
The expected page and server sequence is:
[+] remote NTP load 1: pin
[+] remote NTP load 2: trigger
[page] PASS: embeddedSearch admitted
[page] TRIGGER: navigation + print nested loop
[+] cross-site navigation requested
[+] releasing cross-site navigation
Each line is a progress message. The server reports the first New Tab Page load, which pins the Service Worker, then the second load, which is the trigger. The page reports that it was admitted to the embeddedSearch API and that it started the navigation plus the print nested loop. The server then reports that the cross-site navigation was requested and finally released, which is the moment the navigation is allowed to commit and destroy the frame.
Step 6: read the ASan result
The researcher reproduced the UAF twice without a debugger in the official Windows ASan build 152.0.7939.3. ASan reports:
ERROR: AddressSanitizer: heap-use-after-free
READ of size 1
SearchBox::FocusChanged
chrome/renderer/searchbox/searchbox.cc:290
MiraclePtr Status: NOT PROTECTED
This crash is still exploitable with MiraclePtr.
Reading it line by line: ASan says the program used memory after freeing it. The access was a read of one byte. It happened in SearchBox::FocusChanged, at line 290 of the source file. MiraclePtr, a Chrome defence that makes some freed objects harder to reuse, reports that this particular allocation is not protected, and ASan adds that the crash would still be exploitable even with MiraclePtr in place. The heap is the pool of memory a program uses for objects created while it runs.
ASan stops at that first stale read. The report is careful to separate this from the 32-bit write in the title: the attacker-controlled 32-bit write is a separate Stable x86 exploitability result measured below, not inferred from the ASan READ of size 1 line. In other words, the crash report proves the use-after-free, and the later experiment proves what could be built on top of it.
The attached asan_uaf.log is a complete debugger-free report from the official ASan product. Its deallocation stack contains SearchBox::~SearchBox and RenderFrameImpl::~RenderFrameImpl; its allocation stack contains ChromeContentRendererClient::RenderFrameCreated. A stack here means a stack trace, the list of function calls that led to an event. The deallocation stack shows the object being destroyed, and the allocation stack shows where it was originally created, which together confirm the object was freed and then used.
Step 7: measure the Stable x86 primitive
The shipped 32-bit Stable product was tested with the normal renderer sandbox and multiprocess model retained:
OS: Windows 11
Google Chrome: 150.0.7871.187
Chromium: [redacted]
chrome.exe: [redacted]
chrome.dll: [redacted]
This block records the exact environment: the operating system, the Chrome version, the source revision, and the cryptographic hashes of the two main program files. A hash is a short fingerprint of a file; if the file changes, the fingerprint changes, so anyone can check they are testing the same binaries.
PartitionAlloc's 32-bit freelist shadow allowed the stale pointer to resolve into page-retained ArrayBuffer memory. PartitionAlloc is Chrome's memory allocator. A freelist is the allocator's list of free chunks waiting to be reused; a shadow here means a side structure that keeps track of freed slots. An ArrayBuffer is a block of raw memory that JavaScript can allocate and fill. Page-retained means the memory stays mapped to the page rather than being handed back to the system. The page shaped a fake object and selected a valid entry from the product's Guard CF table. Guard CF, short for Control Flow Guard, is a Windows defence that checks indirect calls jump only to approved targets; its table is the list of approved addresses. A fake object is data the attacker lays out in memory so that a stale pointer, when used, treats it as if it were the real object. The selected native target copied an independently selected DWORD to an independently selected destination. A DWORD is a 32-bit value, four bytes. Native means compiled machine code rather than JavaScript.
The measured transition was:
destination: 0x6b6b746b
before: 0x11223344
value: 0x41424344
after: 0x41424344
adjacent: 0x55667788 -> 0x00000000
This records a before-and-after snapshot. At the destination address 0x6b6b746b, the memory held 0x11223344 before the operation and 0x41424344 after, which is the value the attacker chose. The numbers starting with 0x are hexadecimal, a base-16 way of writing numbers that programmers use for memory addresses and raw values. The adjacent location changed from 0x55667788 to 0x00000000, a side effect described next.
The target also performs mandatory collateral mutations: it replaces one source pointer with the destination, decrements one counter, and clears two fake-object fields. Collateral means unintended side effects that come with the write. The primitive is therefore a constrained chosen-DWORD write, not an unconstrained arbitrary write. A primitive, in exploitation, is a small capability an attacker has gained; constrained means it only works under limits, and chosen-DWORD write means the attacker can pick a four-byte value and a destination, but not freely.
Attachment stable_x86_chosen_dword.log is the raw ordered CDB receipt. CDB is a command-line debugger for Windows. It resolved the randomized module base and observed fixed product instructions; it did not perform the selected write. The module base is where a program file is loaded in memory; ASLR, Address Space Layout Randomisation, deliberately randomises it on each run so attackers cannot hard-code addresses. Attachment stable_x86_write_receipt.json records the independent page readback, the collateral state, the complete native return, and the live renderer probe. Readback means the page read the memory afterwards to confirm the value landed.
Root cause
The vulnerable continuation was introduced by commit [redacted] on 2013-05-29. A commit is a saved change to the source code, with a timestamp and identifier. That change merged key-capture and focus updates into one handler, leaving the new is_focused_ access after the synchronous DispatchKeyCaptureChange() callback.
The same unguarded sequence remains in main revision [redacted], checked on 2026-07-29. Main is the development line of the code, where the newest changes land. Attachment bisection.md contains the introducing diff and source hashes. A diff shows exactly which lines changed.
The object already has a WeakPtrFactory, but the synchronous JavaScript boundary does not consult it. MiraclePtr does not protect the allocation: ASan reports MiraclePtr Status: NOT PROTECTED and states the crash is still exploitable with MiraclePtr.
Impact
An installed search provider selected as default and supplying a remote NTP can trigger a renderer heap-use-after-free without any further page interaction. The allocation is not protected by MiraclePtr.
The Stable x86 result shows that the stale callback can progress beyond a crash to an attacker-selected CFG-valid native target and a constrained chosen-DWORD write, with page-visible readback and a complete native return. The renderer sandbox remained enabled.
The researcher does not claim an autonomous RCE, an unconstrained arbitrary write, an arbitrary read, or a sandbox escape. RCE, remote code execution, means making the target run the attacker's code; autonomous means without further help. An arbitrary write would let an attacker write any value anywhere, and an arbitrary read would let them read any memory. A sandbox escape would mean getting out of the restricted renderer process. The x86 diagnostic used CDB to resolve the randomised module base; it does not prove an in-product ASLR disclosure, autonomous code execution, or the same exploitation primitive on x64. An ASLR disclosure would be a way to learn the randomised address from inside the product itself.
Fix
The suggested invariant is: after dispatching provider JavaScript, do not access SearchBox members until a previously captured weak pointer proves that the object survived. An invariant is a rule that must always hold.
if (can_run_js_in_renderframe_) {
base::WeakPtr<SearchBox> weak_this = weak_ptr_factory_.GetWeakPtr();
SearchBoxExtension::DispatchKeyCaptureChange(
render_frame()->GetWebFrame());
if (!weak_this) {
return;
}
}
Line by line: the if checks that JavaScript may run. base::WeakPtr<SearchBox> weak_this = weak_ptr_factory_.GetWeakPtr(); takes a claim ticket for the object before calling out. The DispatchKeyCaptureChange call then runs the provider's JavaScript. if (!weak_this) { return; } checks the ticket afterwards: if the object is gone, the function returns immediately instead of touching freed memory.
Attachment proposed_fix.patch applies this guard. A regression test should destroy the RenderFrame synchronously from the key-capture callback and verify that FocusChanged() returns without reading the later focus state. A regression test is a test kept in the project so the same bug cannot quietly come back.
Variants to test
- Other synchronous dispatch points in SearchBox. Look for any other member access after a call that can run provider JavaScript. A positive result is a stale read or write in ASan after the callback destroys the frame.
- Other renderer observers with a
WeakPtrFactorythat is not used at a JS boundary. A positive result is a heap-use-after-free where the object is deleted fromOnDestruct()during a synchronous callback. - Nested-loop destruction paths. Try
window.print(), modal dialogs or other nested renderer loops that let a pending cross-process navigation commit while a callback is still on the stack. A modal dialog is a pop-up that blocks the page until dismissed. A positive result is the same deallocation stack containing the observer destructor andRenderFrameImpl::~RenderFrameImpl. - 32-bit PartitionAlloc freelist reuse. On x86 builds, check whether a freed observer slot can be resolved into page-retained
ArrayBuffermemory and shaped into a fake object. A positive result is a controlled readback at a chosen destination with the documented collateral mutations.
Glossary
- API: a list of commands one program offers to another, like a menu.
- Access violation: the operating system stopping a program that reads or writes memory it does not own.
- AddressSanitizer (ASan): a memory checker that reports when a program touches memory it should not.
- Admission: being allowed to use a privileged API, here
embeddedSearch. - ArrayBuffer: a block of raw memory that JavaScript can allocate and fill.
- ASLR: Address Space Layout Randomisation, a defence that loads programs at random addresses each run.
- Build: a particular compiled version of a program.
- Callback: a function the browser calls on the page when something happens.
- CDB: a command-line debugger for Windows.
- CDP: the Chrome DevTools Protocol, a debugging interface for Chrome.
- Certificate: a digital document a server presents to prove its identity over HTTPS.
- Commit (code): a saved change to source code, with an identifier and timestamp.
- Commit (navigation): the moment the browser switches a tab to a newly loaded page.
- Constrained: limited in what it can do.
- Control Flow Guard (Guard CF): a Windows defence that checks indirect calls jump only to approved targets.
- Cross-process navigation: moving a tab from one renderer process to another.
- Cross-site target: a page on a different origin from the one being tested.
- Debugger: a tool that lets a developer pause and inspect a running program.
- Deallocation stack: the list of function calls that led to memory being freed.
- Diff: a display of exactly which lines of code changed.
- Document: the web page itself, with its HTML and JavaScript.
- DWORD: a 32-bit value, four bytes.
- Fake object: data laid out in memory so a stale pointer treats it as a real object.
- Focus: which element on a page is currently receiving input.
- Freelist: an allocator's list of free memory chunks waiting to be reused.
- Hash: a short fingerprint of a file or value.
- Heap: the pool of memory a program uses for objects created while it runs.
- Hexadecimal: a base-16 way of writing numbers, used for addresses and raw values.
- Instant renderer: the renderer process Chrome uses for the New Tab Page feature.
- Invariant: a rule that must always hold.
- Key capture: the browser intercepting keystrokes for its own use.
- Loopback: the address
[redacted], meaning this computer itself. - Main: the development line of the source code.
- MiraclePtr: a Chrome defence that makes some freed objects harder to reuse.
- Modal dialog: a pop-up that blocks the page until dismissed.
- Module base: where a program file is loaded in memory.
- MojoJS: a way to reach Chrome's internal messaging from JavaScript.
- Nested loop: the renderer processing other pending work while a dialog or similar operation is open.
- New Tab Page (NTP): the page shown when you open a new tab; a remote NTP is one supplied by a search provider.
- Object: a bundle of data plus functions that operate on it.
- Observer: an object that registers to be told when something happens.
- Origin: the combination of scheme, host and port that decides what may talk to what.
- PartitionAlloc: Chrome's memory allocator.
- Pinning (Service Worker): keeping a Service Worker installed and alive.
- PoC (proof of concept): a small, deliberately harmless demonstration that proves a bug is real.
- Primitive: a small capability an attacker has gained.
- Profile: the folder where Chrome keeps a user's data.
- Readback: reading memory afterwards to confirm a value landed.
- Redirect: a server telling the browser to go somewhere else.
- Regression test: a test kept in a project so a fixed bug cannot quietly return.
- Renderer: the Chrome process that reads and displays web pages.
- Revision: a unique identifier for one saved state of source code.
- RCE (remote code execution): making the target run the attacker's code.
- Sandbox: a restricted environment that limits what a process can touch.
- Sandbox escape: getting out of the restricted renderer process.
- Service Worker: a background script a website registers to handle requests and survive reloads.
- SPKI fingerprint: a hash of a certificate's public key, used to trust one specific certificate.
- Stable: the normal Chrome release everyone installs.
- Stack trace: the list of function calls that led to an event.
- Synchronous: the caller waits for the called code to finish before continuing.
- Use-after-free (UAF): using memory after it has been freed.
- Weak pointer: a reference that does not keep an object alive and can report whether it still exists.
- WeakPtrFactory: the C++ helper that produces weak pointers.
- x86: the 32-bit variant of a processor architecture.
- x64: the 64-bit variant of a processor architecture.