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

Use after free in Input (CVE-2026-8513)

A use-after-free exists in PassthroughTouchEventQueue when processing touch event acknowledgments. A compromised renderer could trigger a nested message loop and destroy the queue's owner, leading to arbitrary memory write and potential sandbox escape.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 49 days

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

Overview: A potential Use-After-Free (UAF) exists in PassthroughTouchEventQueue when processing touch event acknowledgments. If an ACK triggers a nested message loop (e.g., showing a context menu), a compromised renderer can synchronously destroy the queue's owner, leading to an exploitable UAF when the stack unwinds.

Affected files:

  • components/input/passthrough_touch_event_queue.cc
  • components/input/passthrough_touch_event_queue.h

Estimated timestamp from git blame: 2024-01-22

Summary

A potential Use-After-Free (UAF) vulnerability exists in components/input/passthrough_touch_event_queue.cc within PassthroughTouchEventQueue::AckCompletedEvents() and FlushQueue().

These methods iterate over the outstanding_touches_ set (a std::set) and synchronously dispatch acknowledgments via AckTouchEventToClient(). If an unconsumed touch event sequence forms a gesture like a long press, dispatching the ACK can synchronously trigger UI actions, such as opening a context menu. On platforms like Windows or Aura, showing a native context menu spins a nested message loop on the UI thread.

While the call stack is blocked in this nested message loop, the browser process continues to process incoming IPCs. A compromised renderer can send an IPC to synchronously destroy the widget/WebContents. This cascades into the destruction of RenderWidgetHostImpl, RenderInputRouter, InputRouterImpl, and its inline PassthroughTouchEventQueue member.

When the nested loop eventually exits and the stack unwinds back to the while loop in AckCompletedEvents(), the this pointer is dangling. The loop continues to access the freed memory, specifically evaluating !outstanding_touches_.empty() and calling outstanding_touches_.erase(iter). Additionally, the base::AutoReset<bool> used in this function uses RAW_PTR_EXCLUSION internally, bypassing MiraclePtr protections and causing a secondary UAF write upon destruction.

Potential Exploitation Steps

Note: These are suggested steps, as this analysis is provided by an LLM agent without a working Proof of Concept.

  1. A compromised renderer sends unconsumed touch events (e.g., TouchStart, TouchMove, TouchEnd) simulating a long press.
  2. The renderer sends an InputEventAck to the browser, which is handled by PassthroughTouchEventQueue::AckCompletedEvents().
  3. The browser removes the first event from the set and calls AckTouchEventToClient(), which synchronously bubbles up to RenderWidgetHostViewAura::ProcessAckedTouchEvent.
  4. The unconsumed long press triggers a kGestureLongPress, leading to a context menu request (RunContextMenu), which spins a nested message loop.
  5. During this nested loop, the renderer sends an IPC (e.g., RequestClosePopup or a navigation request) that destroys the RenderWidgetHostImpl and the PassthroughTouchEventQueue.
  6. The renderer immediately sprays the browser heap with fake std::set structures to reclaim the freed memory chunk, setting a non-zero size and controlling the internal red-black tree node pointers.
  7. The context menu closes, the nested loop exits, and execution returns to AckCompletedEvents().
  8. The loop condition reads the attacker's fake size (evaluating to true) and executes outstanding_touches_.erase(iter).
  9. The std::set::erase rebalancing algorithm operates on the attacker's fake pointers, providing a highly reliable arbitrary memory write primitive in the browser process, potentially leading to a Sandbox Escape and Remote Code Execution (RCE).

Suggested Fix

The most robust fix is to ensure the PassthroughTouchEventQueue detects if it has been destroyed during the synchronous AckTouchEventToClient() call.

Add a base::WeakPtrFactory<PassthroughTouchEventQueue> to the class. In AckCompletedEvents() and FlushQueue(), obtain a WeakPtr before the loop and check it after the potentially re-entrant call:

C++
base::WeakPtr<PassthroughTouchEventQueue> weak_this = weak_ptr_factory_.GetWeakPtr();
while (!outstanding_touches_.empty()) {
  auto iter = outstanding_touches_.begin();
  // ... (setup event) ...
  outstanding_touches_.erase(iter);
  AckTouchEventToClient(event, event.ack_source(), event.ack_state());
  if (!weak_this) {
    return; // Object was destroyed during the ACK, bail out safely.
  }
}

Additionally, consider auditing other callers of AckTouchEventToClient for similar synchronous destruction risks.

Evaluated with Chrome root at commit: 0eb4855bda702feaaa8b899336664f97e3df88b8


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. Please feel free to reach out to me if you have concerns or feedback.

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 code does not check if the object was destroyed during a synchronous call that can spin a nested message loop, leading to a dangling pointer.

Impact

A compromised renderer could achieve arbitrary memory write in the browser process, potentially leading to sandbox escape and remote code execution.

What the attacker needed

Compromised renderer; platform with nested message loop (e.g., Windows/Aura)

The fix

The fix should add a WeakPtr check after the synchronous call to detect destruction and bail out safely.

How it was found

  1. A compromised renderer sends unconsumed touch events simulating a long press.
  2. The renderer sends an InputEventAck handled by AckCompletedEvents().
  3. The browser calls AckTouchEventToClient(), which triggers a context menu and a nested message loop.
  4. During the nested loop, the renderer sends an IPC that destroys the RenderWidgetHostImpl and the queue.
  5. The renderer sprays the heap to reclaim the freed memory with fake std::set structures.
  6. The nested loop exits and the loop continues, using the fake set to perform an arbitrary write.

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.

A use-after-free is a bug where a program keeps using memory after it has been freed. Here, a malicious renderer can cause the browser to free an object while it is still in use, letting the attacker control memory and potentially run code.

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.