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

Use after free in Aura (CVE-2026-9934)

A use-after-free in the browser process occurs when a gesture event target window is synchronously destroyed during held event dispatch, leaving a dangling pointer. An attacker could potentially achieve arbitrary memory write and remote code execution.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 47 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 vulnerability exists in the browser process when a gesture event target aura::Window is synchronously destroyed during the processing of held events. Because DispatchGestureEvent lacks proper lifetime tracking before dispatching held events, it continues to use a dangling pointer after the memory is freed. This can lead to an arbitrary memory write and potential Remote Code Execution in the browser process.

Affected files:

  • ui/aura/window_event_dispatcher.cc
  • ui/events/gestures/gesture_recognizer_impl.cc
  • ui/events/gestures/gesture_provider_aura.cc

Estimated timestamp from git blame: 2019-09-26

Summary

A potential Use-After-Free (UAF) vulnerability exists in WindowEventDispatcher::DispatchGestureEvent within the browser process. The issue occurs because the target aura::Window can be synchronously destroyed during the execution of held events, leaving a dangling pointer that is subsequently used for event dispatch and observer tracking.

Technical Details

In ui/aura/window_event_dispatcher.cc, the DispatchGestureEvent function takes a bare pointer ui::GestureConsumer* raw_input_consumer. Before processing the gesture event itself, it synchronously flushes any held events:

C++
void WindowEventDispatcher::DispatchGestureEvent(
    ui::GestureConsumer* raw_input_consumer,
    ui::GestureEvent* event) {
  DispatchDetails details = DispatchHeldEvents();
  if (details.dispatcher_destroyed)
    return;
  Window* target = ConsumerToWindow(raw_input_consumer);
  if (target) {
    // ... uses dangling target pointer
  }
}

If DispatchHeldEvents() triggers an event handler that synchronously destroys the target window, raw_input_consumer becomes a dangling pointer.

MiraclePtr Bypass: During aura::Window destruction, CleanupGestureState() is called. This synchronously deletes the GestureProviderAura object, which destroys its gesture_consumer_ raw_ptr. All other raw_ptr references (such as the parent/child hierarchy and tracking maps in GestureRecognizerImpl) are also cleared synchronously. Since the stack frames in the immediate dispatch path only hold bare C++ pointers, the BackupRefPtr reference count drops to zero. Consequently, the memory is immediately returned to the PartitionAlloc general pool without being quarantined.

Exploitation Primitive: Once the held events finish executing, DispatchGestureEvent converts the dangling pointer to target and proceeds. It eventually calls WindowEventDispatcher::PreDispatchEvent, which executes CHECK(window()->Contains(target_window)). An attacker who has reallocated the freed memory can spoof the parent_ pointer to point back to the root window, easily bypassing this check. Finally, a WindowTracker is instantiated on the stack, which calls target_window->AddObserver(this). This executes an emplace_back on the inline std::vector inside the Window's base::ObserverList. By controlling the vector's internal pointers (e.g., finish) in the reallocated memory block, the attacker gains a highly reliable arbitrary memory write primitive in the browser process.

Suggested Attacker Steps

Please note these are potential steps; our tooling has not yet executed a working proof-of-concept.

  1. Initiate a timer-based gesture (e.g., long-press) on a target window.
  2. Before the timer fires, trigger a layout change (e.g., viewport resize) to cause the WindowEventDispatcher to hold pointer moves.
  3. Send pointer move events, which are then aggregated into held_move_event_.
  4. When the long-press timer fires, DispatchGestureEvent is invoked with a bare pointer to the target window.
  5. DispatchGestureEvent immediately calls DispatchHeldEvents(), dispatching the held move event.
  6. The move event handler executes and synchronously deletes the target window. The memory is immediately freed and reclaimed by the attacker with crafted data.
  7. DispatchGestureEvent resumes, dereferencing the dangling pointer, bypassing the Contains check, and writing an observer pointer to an attacker-controlled address via std::vector::emplace_back.

Potential Fix

To fix this issue, DispatchGestureEvent should track the raw_input_consumer's lifecycle during DispatchHeldEvents(). Since GestureConsumer doesn't inherently support observers, the safest approach is to resolve the Window first and use a WindowTracker, identical to the pattern already used in PreDispatchEvent:

C++
void WindowEventDispatcher::DispatchGestureEvent(
    ui::GestureConsumer* raw_input_consumer,
    ui::GestureEvent* event) {
  Window* target = ConsumerToWindow(raw_input_consumer);
  WindowTracker target_window_tracker;
  if (target)
    target_window_tracker.Add(target);

  DispatchDetails details = DispatchHeldEvents();
  if (details.dispatcher_destroyed)
    return;

  if (!target || target_window_tracker.windows().empty())
    return; // Target window was destroyed during held events dispatch.

  event->ConvertLocationToTarget(window(), target);
  details = DispatchEvent(target, event);
  // ...
}

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 function DispatchGestureEvent does not track the lifetime of the target window before dispatching held events, so it uses a dangling pointer after the window is destroyed.

Impact

An attacker could potentially achieve arbitrary memory write and remote code execution in the browser process, though the report notes that a working proof-of-concept has not been executed.

What the attacker needed

Victim visits a malicious page; browser process; no special privileges

The fix

The fix should track the target window's lifetime during held event dispatch, for example by using a WindowTracker, and return early if the window was destroyed.

How it was found

  1. Initiate a timer-based gesture (e.g., long-press) on a target window.
  2. Before the timer fires, trigger a layout change (e.g., viewport resize) to cause the WindowEventDispatcher to hold pointer moves.
  3. Send pointer move events, which are then aggregated into held_move_event_.
  4. When the long-press timer fires, DispatchGestureEvent is invoked with a bare pointer to the target window.
  5. DispatchGestureEvent immediately calls DispatchHeldEvents(), dispatching the held move event.
  6. The move event handler executes and synchronously deletes the target window. The memory is immediately freed and reclaimed by the attacker with crafted data.

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 happens when a program frees memory but keeps using a pointer to it. Here, a window can be closed while the browser is still handling a gesture, so the browser later writes to memory that may have been reused by an attacker. This could let an attacker control what gets written and where, potentially leading to code execution.

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.