Use after free in Ozone (CVE-2026-10902)
A use-after-free was reported in the Wayland toplevel window handling code, where a delegate callback can synchronously close and destroy the window object while a member function is still running. The report claims a compromised renderer or attacker could trigger a configure event that leads to the freed object being used again, though no working exploit was demonstrated.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 7 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. 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 WaylandToplevelWindow::HandleToplevelConfigure due to synchronous destruction of the window object during activation state callbacks. When the delegate callback synchronously closes the widget, this is deleted, resulting in a UAF when the function subsequently calls UpdateSessionStateIfNeeded(). This potential issue affects the browser process on Linux/Wayland and is not protected by MiraclePtr.
Affected files:
ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
Estimated timestamp from git blame: 2025-03-27
Summary
There is a potential Use-After-Free (UAF) vulnerability in WaylandToplevelWindow::HandleToplevelConfigure inside the desktop Linux/Wayland browser process. When handling window configuration events, the platform window delegate can synchronously close and destroy the widget and its associated platform window. This deletes the WaylandToplevelWindow object (this) while the execution is still inside one of its member functions, leading to subsequent member variable accesses and method calls on the freed memory.
Root Cause Analysis
In ui/ozone/platform/wayland/host/wayland_toplevel_window.cc, the method WaylandToplevelWindow::HandleToplevelConfigure is implemented as follows:
void WaylandToplevelWindow::HandleToplevelConfigure(
int32_t width_dip, int32_t height_dip,
const WindowStates& window_states) {
HandleToplevelConfigureWithOrigin(0, 0, width_dip, height_dip, window_states); // [1] Can synchronously delete `this`
UpdateSessionStateIfNeeded(); // [2] Use-After-Free
}
-
Synchronous Deletion: Inside
HandleToplevelConfigureWithOrigin[1], the methodUpdateActivationState()is called (line 569). If the activation state changes, it notifies the delegate (line 459):C++ delegate()->OnActivationChanged(is_active_);On Wayland, the platform window delegate is
DesktopWindowTreeHostPlatform. As documented indesktop_window_tree_host_platform.cc, handling activation changes can synchronously close and destroy the widget and thereby its ownedPlatformWindow(theWaylandToplevelWindowobject):C++ // HandleActivationChanged() notifications can cause the widget to be // synchronously closed. auto weak_this = weak_factory_.GetWeakPtr(); desktop_native_widget_aura_->HandleActivationChanged(active);When the widget is synchronously closed,
DesktopWindowTreeHostPlatform::OnClosed()callsSetPlatformWindow(nullptr), which releases and deletes theWaylandToplevelWindowobject. -
Use-After-Free: When execution returns to
HandleToplevelConfigure[2],thishas already been deleted. The method then proceeds to callUpdateSessionStateIfNeeded(), which dereferences members of the deleted object (such asxdg_toplevel_orsession_at line 978), leading to a potential Use-After-Free.
Potential Trigger Steps
Because our tooling lacks the capability to execute code or build functional exploits, these are theoretical steps representing how an attacker might attempt to trigger this potential vulnerability:
- The attacker (or a compromised renderer) causes a state change that makes the Wayland compositor send an
xdg_toplevel.configureevent. - The
xdg_toplevelconfigure event is processed byXdgToplevel::OnToplevelConfigure, which callsHandleToplevelConfigure. - The configure flow notifies the delegate of an activation state change.
- An observer responding to the activation change synchronously calls
Widget::CloseNow(), which immediately deletes theWaylandToplevelWindowobject. - The stack unwinds back to
HandleToplevelConfigure, which callsUpdateSessionStateIfNeeded(), dereferencing the freedthispointer.
Suggested Remediation
Use a WeakPtr guard in HandleToplevelConfigure to verify if the window is still alive before calling UpdateSessionStateIfNeeded(). A similar safe pattern is used elsewhere in the Ozone platform (e.g., in X11):
void WaylandToplevelWindow::HandleToplevelConfigure(
int32_t width_dip,
int32_t height_dip,
const WindowStates& window_states) {
auto weak_this = weak_ptr_factory_.GetWeakPtr();
HandleToplevelConfigureWithOrigin(0, 0, width_dip, height_dip, window_states);
if (!weak_this) {
return;
}
UpdateSessionStateIfNeeded();
}
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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 function calls a delegate callback that can synchronously destroy the window object, and then continues to use `this` without checking whether it is still alive.
Impact
The report claims a potential use-after-free in the browser process on Linux/Wayland that is not protected by MiraclePtr, which could lead to memory corruption, but no exploit was built and the trigger steps are theoretical.
What the attacker needed
Linux with Wayland; ability to trigger a configure event; activation state change during configure
The fix
A weak pointer guard should be added so the function returns early if the window was destroyed during the callback.
How it was found
- Cause a state change so the Wayland compositor sends a toplevel configure event.
- The configure event is processed and reaches the toplevel window handler.
- The configure flow notifies the delegate of an activation state change.
- An observer responding to the activation change synchronously closes the widget, deleting the window object.
- Execution returns to the handler, which calls a session state update on the freed object.
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 a program frees an object's memory but keeps using it, that is called a use-after-free. Here, a window object can be closed and deleted in the middle of a function that is still working on it, so the function later reads memory that no longer belongs to it. This can crash the browser and, in principle, be abused to run attacker-controlled 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.