Use after free in Views (CVE-2026-79257)
A use-after-free was reported in the desktop views menu code: when a mouse move updates the selected item, synchronous accessibility events can close the menu and destroy the controller, after which the caller keeps using the freed object. An attacker could potentially trigger memory corruption, but the text says no proof of concept was executed.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential Use-After-Free (UAF) vulnerability exists in the desktop views menu system when processing mouse movement events. Under certain conditions, synchronously dispatched platform accessibility events can cause the MenuController and its associated views to be deleted during selection updates. Because MenuController::OnMouseMoved lacks a WeakPtr safety check after updating the selection, it may continue execution using freed 'this' and dangling view pointers.
Affected files:
ui/views/controls/menu/menu_controller.cc
Estimated timestamp from git blame: 2020-10-06
Description
A potential Use-After-Free (UAF) vulnerability has been identified in MenuController::OnMouseMoved within ui/views/controls/menu/menu_controller.cc.
When a mouse move event is processed by MenuController::OnMouseMoved, the controller retrieves a raw pointer to a child Button and calls HandleMouseLocation. Under certain conditions (such as when platform accessibility tools are active), HandleMouseLocation invokes SetSelection to update the selected menu item. This update can trigger synchronous accessibility notifications (e.g., popup focus overrides or selection changes).
If an active accessibility client or system hook responds to these events by requesting the menu to close, the menu runner synchronously destroys the MenuController and tears down the entire MenuItemView tree. Although SetSelection contains safety checks using base::WeakPtr to abort early if this is deleted, its caller OnMouseMoved does not verify if the controller is still valid upon returning from HandleMouseLocation. It subsequently attempts to use the freed this pointer and the dangling Button pointer.
Potential Attack/Trigger Steps
Note: These are suggested steps based on static code analysis; we have not executed this flow or produced a working proof of concept.
- The user (or an automated system with accessibility features enabled) opens a menu containing hot-trackable buttons (such as zoom or option controls).
- The mouse cursor is moved over a button, triggering a mouse move event that is routed to
MenuController::OnMouseMoved. - The view is resolved to a
Button* new_hot_tracked_buttonraw pointer. HandleMouseLocationis invoked, which routes toSetSelection.SetSelectionsets a popup focus override, firing synchronous platform-specific accessibility events.- A platform accessibility listener synchronously closes the menu in response to the focus event, leading to the destruction of the
MenuControllerand all associated views. - Control returns to
OnMouseMoved, which continues execution without a safety check, dereferencing the deletedthispointer and the now-danglingnew_hot_tracked_buttonpointer insideSetHotTrackedButtonandMaybeForwardToAnnotation.
Suggested Fix
Introduce a base::WeakPtr safety check in MenuController::OnMouseMoved immediately after the call to HandleMouseLocation, matching the defensive patterns used elsewhere in MenuController:
base::WeakPtr<MenuController> this_ref = AsWeakPtr();
HandleMouseLocation(source, event.location());
if (!this_ref) {
return;
}
Evaluated with Chrome root at commit: fb72408a8493c46bc75fae1c70d03daec96b3040
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
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 caller OnMouseMoved does not re-check that the MenuController still exists after HandleMouseLocation returns, even though the callee can synchronously destroy it.
Impact
If the flow can be triggered, the freed controller and dangling button pointer could be dereferenced, potentially leading to memory corruption; the text does not demonstrate this and notes the steps are unverified.
What the attacker needed
Accessibility features enabled; user moves mouse over a menu button
The fix
A WeakPtr check should be added in OnMouseMoved right after HandleMouseLocation returns, so execution stops if the controller was destroyed.
How it was found
- Open a menu containing hot-trackable buttons with accessibility features enabled.
- Move the mouse over a button so the mouse move event reaches the menu controller.
- The controller resolves the view to a raw button pointer and calls HandleMouseLocation, which routes to SetSelection.
- SetSelection sets a popup focus override, firing synchronous accessibility events.
- An accessibility listener closes the menu, destroying the controller and its views.
- Control returns to OnMouseMoved, which uses the deleted controller and dangling button pointer.
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 deletes an object but keeps a pointer to it and later uses that pointer, which can crash the program or let an attacker influence memory. Here, moving the mouse over a menu item can cause accessibility software to close the menu, deleting the menu controller while the mouse-handling code is still running. The report is based on reading the code, not on running an exploit.
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.