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

Use after free in UI (CVE-2026-9937)

A use-after-free and write-after-free exists in RenderWidgetHostViewAura::OnBoundsChanged on Windows, where a synchronous COM callout to a TSF IME during window resizing allows nested task execution. A compromised renderer can synchronously destroy the view via a popup close IPC, bypassing MiraclePtr and leading to an unprotected 1-byte write-after-free.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 45 days

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: A potential Use-After-Free and Write-After-Free exists in RenderWidgetHostViewAura::OnBoundsChanged on Windows. A synchronous COM callout to a TSF IME during window resizing allows nested task execution, enabling a compromised renderer to synchronously destroy the view via a popup close IPC. This bypasses MiraclePtr, leading to an unprotected 1-byte write-after-free when a stack-allocated base::AutoReset is destroyed.

Affected files:

  • content/browser/renderer_host/render_widget_host_view_aura.cc
  • ui/base/ime/win/tsf_text_store.cc
  • ui/base/ime/win/input_method_win_tsf.cc
  • ui/base/ime/win/tsf_bridge.cc

Estimated timestamp from git blame: 2021-10-07

Description

In content/browser/renderer_host/render_widget_host_view_aura.cc, the OnBoundsChanged method utilizes a stack-allocated base::AutoReset<bool> to manage the in_bounds_changed_ state. It subsequently calls GetInputMethod()->OnCaretBoundsChanged(this). On Windows, this triggers a synchronous COM callout to the active third-party Text Services Framework (TSF) IME via TSFTextStore::SendOnLayoutChange.

During a user-initiated window move or resize, ScopedAllowApplicationTasksInNativeNestedLoop is active (instantiated in HWNDMessageHandler). If the third-party IME pumps the Windows message loop during the synchronous COM callout, Chrome will process pending tasks from its queues, including Mojo IPC messages.

Because popup widgets are self-owned, a compromised renderer can send a blink::mojom::PopupWidgetHost::RequestClosePopup IPC to synchronously delete the RenderWidgetHostImpl and its associated RenderWidgetHostViewAura while OnBoundsChanged is still on the stack.

When the COM callout returns, the stack unwinds into the deleted object. The base::AutoReset destructor attempts to write false (0x00) back to the in_bounds_changed_ member variable. Crucially, base::AutoReset's internal pointer uses RAW_PTR_EXCLUSION for performance reasons. This results in an unprotected 1-byte Write-After-Free at a fixed offset.

MiraclePtr Bypass

BackupRefPtr (MiraclePtr) typically protects against UAFs by quarantining freed memory if raw_ptr references still exist. However, during normal teardown, Chrome gracefully clears raw_ptr references (such as deleting the aura::Window and detaching the input method delegate) before RenderWidgetHostViewAura is actually freed. Because the raw_ptr reference count reaches zero prior to the memory being freed, the memory is physically returned to the allocator and is not quarantined. This allows an attacker to reliably reclaim the memory before the stack unwinds.

Potential Attacker Steps

  1. Compromise a renderer process to gain arbitrary code execution within the sandbox.
  2. Open a popup window, creating a self-owned RenderWidgetHostImpl in the browser process.
  3. Induce a window bounds change (e.g., resizing) to enter RenderWidgetHostViewAura::OnBoundsChanged.
  4. Send a RequestClosePopup Mojo IPC to the browser process precisely when the TSF IME is pumping the message loop during the COM callout.
  5. Send additional IPCs to spray the browser process heap, reclaiming the freed RenderWidgetHostViewAura memory with controlled data (e.g., null bytes).
  6. When the stack unwinds, UpdateInsetsWithVirtualKeyboardEnabled() executes safely using the controlled data, followed by the unprotected 0x00 write-after-free from ~AutoReset, which can be leveraged to corrupt adjacent structures for a Sandbox Escape / RCE.

Note: Please note that these are suggested/potential steps; our tooling agent doesn't yet have the ability to run code to produce a working proof-of-concept.

Suggested Fix

The base::AutoReset class assumes the underlying object will outlive the scope. To resolve this, avoid using base::AutoReset when synchronous callouts could lead to object destruction. Instead, capture a base::WeakPtr<RenderWidgetHostViewAura> and manually check its validity after the COM callout returns before accessing this or updating any member variables.

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, the use of a stack-allocated base::AutoReset to manage state across a synchronous COM callout that can trigger nested task execution and object destruction, combined with MiraclePtr not quarantining the memory because raw_ptr references are cleared during teardown.

Impact

A compromised renderer could potentially achieve a sandbox escape and remote code execution by corrupting adjacent structures via the write-after-free, though the report notes these are suggested steps without a working proof-of-concept.

What the attacker needed

Compromised renderer process; Windows with third-party TSF IME; user-initiated window move or resize

The fix

The base::AutoReset should be replaced with a base::WeakPtr check after the COM callout returns to avoid accessing a destroyed object.

How it was found

  1. Compromise a renderer process to gain arbitrary code execution within the sandbox.
  2. Open a popup window, creating a self-owned RenderWidgetHostImpl in the browser process.
  3. Induce a window bounds change (e.g., resizing) to enter RenderWidgetHostViewAura::OnBoundsChanged.
  4. Send a RequestClosePopup Mojo IPC to the browser process precisely when the TSF IME is pumping the message loop during the COM callout.
  5. Send additional IPCs to spray the browser process heap, reclaiming the freed RenderWidgetHostViewAura memory with controlled data.
  6. When the stack unwinds, the unprotected 0x00 write-after-free from ~AutoReset can be leveraged to corrupt adjacent structures for a Sandbox Escape / RCE.

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.

This report describes a memory safety bug in Chrome's browser process on Windows. When a window is resized, Chrome calls into a third-party input method editor (IME) that can run other tasks, including a message from a compromised renderer that deletes the window object. Later, Chrome writes to that freed memory, which an attacker could exploit to escape the sandbox.

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.