Use after free in Views (CVE-2026-11042)
A use-after-free exists in the browser's RootView mouse handling: when moving the mouse to a new view, an exit event is sent to the old view, and if that handler deletes the new view, a dangling pointer is later used. An attacker who can trigger this UI state change could heap-spray to reclaim the freed memory and potentially achieve remote code execution and sandbox escape.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
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 security team.
Overview: A potential Use-After-Free (UAF) vulnerability exists in the browser process's RootView::HandleMouseEnteredOrMoved method. When the mouse moves to a new view, an exit event is synchronously dispatched to the old view. If the old view's handler synchronously deletes the new view, the local raw pointer representing the new view becomes a dangling pointer, which is subsequently used for event dispatch and virtual method calls.
Affected files:
ui/views/widget/root_view.ccui/views/widget/root_view.hui/events/event_dispatcher.cc
Estimated timestamp from git blame: 2025-07-29
Summary
A potential Use-After-Free (UAF) vulnerability exists in the Browser process within ui/views/widget/root_view.cc. The issue occurs in RootView::HandleMouseEnteredOrMoved when a user moves the mouse from one view (V_old) to another (V_new). The code synchronously dispatches a kMouseExited event to V_old while holding a local raw pointer (View* v) to V_new. If V_old's event handler triggers a UI update that deletes V_new, the pointer v becomes dangling. This pointer is later passed to DispatchEvent, leading to virtual method calls on freed memory.
Technical Details
In RootView::HandleMouseEnteredOrMoved, the following sequence can lead to a UAF:
- A local raw pointer
View* vis obtained viaGetEventHandlerForPoint()(around line 873). This pointer represents the view the mouse has moved into (V_new). - The code dispatches a
kMouseExitedevent to the previous handler,mouse_move_handler_(V_old) (around line 892). - If
V_old'sOnMouseExitedhandler (or a related observer) synchronously removes and deletes viewv(V_new), the pointervbecomes dangling. - MiraclePtr Bypass: Because
vis a localView*(not araw_ptr), and because removing the view from its parent clears theraw_ptrin the parent'schildren_vector, the BackupRefPtr (BRP) reference count drops to 0. The memory is returned directly to the PartitionAlloc freelist without being quarantined. - The execution returns from the
kMouseExiteddispatch. The code checksif (!dispatch_details.target_destroyed)(line 898), but this only verifies thatV_oldwasn't destroyed; it doesn't checkv. - The execution proceeds to use the dangling pointer
v:- Line 906:
NotifyEnterExitOfDescendantis called withv. This triggers a UAF read (v->parent_) inView::Contains. - Line 913:
mouse_move_handler_ = v;. Assigning the dangling pointer to araw_ptrincrements the BRP refcount on potentially attacker-reclaimed memory, finalizing the BRP bypass. - Line 922:
DispatchEventis called withmouse_move_handler_.
- Line 906:
DispatchEventeventually routes toui::EventDispatcher::ProcessEvent, which calls the pure virtual methodtarget->CanAcceptEvent(*event).
Impact and Exploitability
If an attacker can trigger a UI state change that synchronously deletes V_new during the exit dispatch of V_old, they can subsequently heap-spray the Browser process to reclaim the freed memory chunk backing V_new. The UAF read of v->parent_ can be bypassed by setting the fake parent_ to nullptr. The virtual method call to CanAcceptEvent will then dereference a fake vtable pointer provided by the attacker, leading to Remote Code Execution (RCE) and a full sandbox escape.
Note: This sequence describes a potential exploit path. Our tooling agent does not yet have the ability to run code or provide a working proof of concept (PoC).
Suggested Fix
Protect the local variable v using a ViewTracker.
// Include the tracker
#include "ui/views/view_tracker.h"
// In RootView::HandleMouseEnteredOrMoved:
View* raw_v = GetEventHandlerForPoint(event.location());
ViewTracker v_tracker(raw_v);
// ...
// Replace uses of `v` with `v_tracker.view()` and check if it is non-null after DispatchEvent returns.
Alternatively, v could be wrapped in a base::WeakPtr<View> if View supports it, or mouse_move_handler_ and event dispatch logic could be refactored to better handle asynchronous destruction.
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
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 holds a raw pointer to the new view across a synchronous event dispatch that can delete that view, without re-checking its validity afterwards.
Impact
An attacker who can trigger the UI state change could heap-spray to reclaim the freed memory and potentially achieve remote code execution and a full sandbox escape, though the report notes this is a potential path and no working proof of concept exists yet.
What the attacker needed
Ability to trigger specific UI state change; heap-spray capability in browser process
The fix
The local pointer should be protected with a ViewTracker (or a weak pointer) and checked for null after the event dispatch returns.
How it was found
- The mouse moves from one view to another, and a raw pointer to the new view is obtained.
- A mouse-exited event is synchronously dispatched to the old view.
- The old view's handler deletes the new view, making the pointer dangling.
- Execution continues and uses the dangling pointer for further event dispatch and virtual method calls.
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 keeps a reference to memory it has already freed and then uses it again. Here, the browser remembers a view (a part of the window) but that view can be deleted by another part of the code before the browser uses it, so the browser ends up reading or calling methods on memory that may now contain attacker-controlled data.
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.