Use after free in Ozone (CVE-2026-10972)
A use-after-free was reported in the Linux/X11 Ozone window code, where handling an X11 event can synchronously destroy the window object while the dispatch function keeps using it. A compromised GPU process could send synthetic crossing events to trigger the dangling pointer and potentially escape its sandbox into the browser process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 20 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. 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 Linux/X11 Ozone platform implementation. Synchronous destruction of the X11Window object during event processing can leave the dispatch loop with a dangling pointer, resulting in memory corruption.
Affected files:
ui/ozone/platform/x11/x11_window.cc
Estimated timestamp from git blame: 2020-02-04
Summary
A potential Use-After-Free (UAF) vulnerability has been identified in X11Window::DispatchUiEvent within the Linux/X11 Ozone platform implementation. The issue arises when an incoming X11 event triggers a sequence of notifications that synchronously destroy the X11Window instance. The function continues to access member variables and invokes virtual methods via the freed this pointer because it lacks a liveness check after the event handling call.
Technical Details
In ui/ozone/platform/x11/x11_window.cc, the DispatchUiEvent function handles incoming X11 events. At line 1385, it calls HandleEvent(xev):
void X11Window::DispatchUiEvent(ui::Event* event, const x11::Event& xev) {
// ...
HandleEvent(xev); // [1] Possible synchronous destruction
x11::Event last_xev;
std::unique_ptr<ui::Event> last_motion;
if (CoalesceEventsIfNeeded(xev, event->type(), &last_xev)) { // [2] UAF read
// ...
}
// ...
UpdateWMUserTime(event); // [3] UAF read
DispatchEventFromNativeUiEvent(
event, base::BindOnce(&PlatformWindowDelegate::DispatchEvent,
base::Unretained(platform_window_delegate()))); // [4] UAF read + virtual call
}
Synchronous destruction can occur when processing an activation-related event (e.g., x11::CrossingEvent). Based on the code, the following sequence of events is possible:
HandleEventrecognizes aCrossingEventand callsOnCrossingEvent.OnCrossingEventupdates the window's activation state and callsAfterActivationStateChanged().AfterActivationStateChanged()detects a change inIsActive()and notifies thePlatformWindowDelegate(typically an instance ofDesktopWindowTreeHostPlatform) viaOnXWindowIsActiveChanged().DesktopWindowTreeHostPlatform::OnActivationChanged()notifies the associatedDesktopNativeWidgetAura.- The notification propagates to the
Widget, which informs its observers. If the widget is a popup or bubble withclose_on_deactivateenabled, an observer may trigger synchronous window closure (e.g., viaWidget::CloseNow()). - The destruction of the
Widgetleads to the immediate deletion of theDesktopWindowTreeHostPlatformand its ownedX11Windowinstance.
When HandleEvent returns to DispatchUiEvent, the this pointer is dangling. The function then performs multiple UAF reads, including calls to CoalesceEventsIfNeeded and UpdateWMUserTime. Most critically, at line 1427, it reads the platform_window_delegate_ pointer from the freed memory and uses it in a base::BindOnce callback that performs a virtual call (DispatchEvent).
Potential Attack Vector
A compromised GPU process could potentially trigger this vulnerability. On Linux configurations using X11, the GPU process maintains a connection to the X server. An attacker can use this connection to send synthetic CrossingEvent (LeaveNotify) messages to the window IDs of sensitive windows in the Browser process. By targeting windows known to close synchronously upon losing focus, the attacker can trigger the UAF. This represents a potential sandbox escape from the GPU process to the Browser process.
MiraclePtr Status
This vulnerability is not protected by MiraclePtr (BackupRefPtr). The issue is a Use-After-Free of the X11Window object itself via a raw this pointer. While some member variables like platform_window_delegate_ are raw_ptr, the initial UAF occurs when reading the pointer value from the freed X11Window allocation, which MiraclePtr does not prevent.
Suggested Fix
Apply a liveness check using a base::WeakPtr after the call to HandleEvent(xev) in DispatchUiEvent. This pattern is already utilized in DesktopWindowTreeHostPlatform::OnActivationChanged to guard against similar synchronous destruction scenarios.
void X11Window::DispatchUiEvent(ui::Event* event, const x11::Event& xev) {
// ...
auto weak_this = weak_ptr_factory_.GetWeakPtr();
HandleEvent(xev);
if (!weak_this) {
return;
}
// ... proceed with subsequent member accesses
}
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
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 dispatch function lacks a liveness check after the event handling call, so it continues to read members and make a virtual call through a freed this pointer.
Impact
A compromised GPU process could potentially trigger the use-after-free and escape its sandbox into the browser process, though the report frames this as a potential issue rather than a demonstrated exploit.
What the attacker needed
Linux with X11; control of the GPU process; target window closes on focus loss
The fix
A liveness check using a weak pointer should be added after the event handling call so the function returns early if the window was destroyed.
How it was found
- HandleEvent recognises a crossing event and calls OnCrossingEvent.
- OnCrossingEvent updates activation state and calls AfterActivationStateChanged.
- AfterActivationStateChanged notifies the platform window delegate of the active-state change.
- The notification reaches the widget, and an observer may close a popup or bubble synchronously.
- Closing the widget deletes the window host and its owned X11Window instance.
- Control returns to the dispatch function, which then uses 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 but keeps a pointer to it and later reads or calls through that pointer, this is called a use-after-free. Here, handling a window event can cause the window object to be deleted immediately, yet the same function carries on using it, which can corrupt memory. The report suggests an attacker who already controls one sandboxed process might exploit this to reach a more privileged one.
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.