Use after free in Input (CVE-2026-9933)
A use-after-free vulnerability exists in the browser process when synthetic touch cancellation events are dispatched. If a window is synchronously destroyed during the loop, a cached pointer becomes dangling, allowing a virtual call on freed memory that could be hijacked.
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 synthetic touch cancellation events are dispatched. If a window is synchronously destroyed during the loop, a cached pointer becomes dangling, leading to a virtual call on freed memory. MiraclePtr does not prevent this due to the object explicitly dropping its raw_ptr reference during destruction.
Affected files:
ui/events/gestures/gesture_recognizer_impl.ccui/aura/window_event_dispatcher.ccui/events/gestures/gesture_types.h
Estimated timestamp from git blame: 2025-10-17
Description
A potential Use-After-Free (UAF) vulnerability exists in the browser process within ui/events/gestures/gesture_recognizer_impl.cc.
When multiple active touches need to be canceled, GestureRecognizerImpl::CancelActiveTouchesImpl retrieves a GestureEventHelper* (typically a WindowEventDispatcher) and stores it in a bare local pointer variable (helper). It then enters a for loop, iterating over all active touch points and dispatching a synthetic kTouchCancelled event for each:
bool GestureRecognizerImpl::CancelActiveTouchesImpl(GestureConsumer* consumer) {
GestureEventHelper* helper = FindDispatchHelperForConsumer(consumer);
// ...
std::vector<std::unique_ptr<TouchEvent>> cancelling_touches =
GetCancelledEventPerPointForConsumer(consumer);
// ...
for (const std::unique_ptr<TouchEvent>& cancelling_touch : cancelling_touches)
helper->DispatchSyntheticTouchEvent(cancelling_touch.get());
return true;
}
The vulnerability occurs if the UI event handler receiving the first kTouchCancelled event responds by synchronously destroying the window (e.g., via Widget::CloseNow()). This destroys the WindowTreeHost, which immediately destroys the WindowEventDispatcher.
Because WindowEventDispatcher::DispatchSyntheticTouchEvent has a void return type, it cannot signal its destruction back to the caller. The for loop simply proceeds to the next active touch point and calls helper->DispatchSyntheticTouchEvent(...) using the now-dangling helper pointer. Since this is a virtual method call, it requires reading the object's vtable, providing an attacker a potential path to hijack the control flow.
MiraclePtr / BRP Bypass
MiraclePtr (BackupRefPtr) does not protect this specific code path. When WindowEventDispatcher is destroyed, its destructor explicitly unregisters itself by calling Env::GetInstance()->gesture_recognizer()->RemoveGestureEventHelper(this). This removes the dispatcher from GestureRecognizerImpl::helpers_ (a std::vector of raw_ptr).
Because the only active raw_ptr is destroyed during the teardown sequence, the BRP reference count for the object drops to zero. The memory is immediately freed to the allocator rather than quarantined, allowing an attacker to reclaim the memory via heap spraying before the second loop iteration occurs.
Potential Reproduction Steps
Note: These are suggested/potential steps to trigger the vulnerability. Our tooling agent does not yet have the ability to run code to verify an exploit chain.
- From a compromised renderer, open a new popup window or widget (creating a new
WindowTreeHostandWindowEventDispatcher). - Dispatch at least two simultaneous active touch events to the popup.
- Trigger an action that forces the browser to cancel the active touches (e.g., a capture change, or initiating a navigation that triggers
RenderWidgetHostViewAura::CancelActiveTouches). - If the popup's event handler processes the first
kTouchCancelledevent by synchronously closing itself (e.g., calling a destruction sequence that triggersCloseNow()), the underlying dispatcher is freed. - The loop in
CancelActiveTouchesImplproceeds to the second touch point and dereferences the freed dispatcher, executing a hijacked virtual call if the heap was successfully sprayed.
Suggested Fix
Do not use a bare pointer across loop iterations where synchronous dispatch might destroy the object. One potential fix is to verify the liveness of the helper before each iteration. Since helpers_ is maintained by the GestureRecognizerImpl, the loop could verify the helper still exists in the helpers_ vector:
for (const std::unique_ptr<TouchEvent>& cancelling_touch : cancelling_touches) {
// Verify the helper hasn't been destroyed by the previous dispatch.
if (std::ranges::find(helpers_, helper) == helpers_.end())
break;
helper->DispatchSyntheticTouchEvent(cancelling_touch.get());
}
Alternatively, GestureEventHelper could be updated to support base::WeakPtr, allowing the loop to safely track its lifetime.
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.
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 uses a bare pointer to a GestureEventHelper across loop iterations without checking if the object was destroyed by a synchronous event handler.
Impact
An attacker could potentially hijack control flow by reclaiming the freed memory via heap spraying before the second loop iteration occurs.
What the attacker needed
Compromised renderer; popup window with touch events; synchronous window destruction
The fix
The code should verify the liveness of the helper before each iteration or use a WeakPtr to track its lifetime.
How it was found
- From a compromised renderer, open a new popup window or widget.
- Dispatch at least two simultaneous active touch events to the popup.
- Trigger an action that forces the browser to cancel the active touches.
- If the popup's event handler processes the first kTouchCancelled event by synchronously closing itself, the underlying dispatcher is freed.
- The loop proceeds to the second touch point and dereferences the freed dispatcher.
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 you touch a screen, the browser sends events to cancel touches. The code keeps a pointer to an object that handles these events. If that object is destroyed while the loop is still running, the pointer points to freed memory, and the next call can be hijacked by an attacker.
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.