Use after free in Ozone (CVE-2026-13855)
A use-after-free was reported in the X11 window event dispatch code, where synchronous processing of pending X server events during a mouse event can re-enter and destroy the window. An attacker could potentially trigger a browser-process crash or memory corruption, though the report notes no working proof of concept was produced.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 15 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 browser-process Use-After-Free (UAF) vulnerability exists in X11Window::DispatchEvent on Linux/X11. Synchronous dispatch of pending X11 events during mouse dispatch can lead to re-entrant window destruction. Since there is no WeakPtr guard on 'this' inside DispatchEvent, execution proceeds with a freed window pointer, resulting in a UAF.
Affected files:
ui/ozone/platform/x11/x11_window.ccui/ozone/platform/x11/x11_window_manager.ccui/ozone/platform/x11/x11_screen_ozone.cc
Estimated timestamp from git blame: 2025-03-06
Root Cause
In ui/ozone/platform/x11/x11_window.cc, X11Window::DispatchEvent invokes X11WindowManager::GetInstance()->MouseOnWindow(this) for incoming mouse events, but does not guard itself against potential re-entrant destruction of this:
uint32_t X11Window::DispatchEvent(const PlatformEvent& event) {
...
if (event->IsMouseEvent()) {
X11WindowManager::GetInstance()->MouseOnWindow(this); // Synchronously dispatches events/replies
}
#if BUILDFLAG(USE_ATK)
if (HandleAsAtkEvent(current_xevent)) { // Dereferences freed 'this'
return POST_DISPATCH_STOP_PROPAGATION;
}
#endif
DispatchUiEvent(event, current_xevent); // Dereferences freed 'this'
return POST_DISPATCH_STOP_PROPAGATION;
}
MouseOnWindow can synchronously reach window->GetBoundsInPixels(), which in turn queries geometry_cache_->GetBoundsPx(). If the geometry cache is not yet ready, it can synchronously run pending X server events via parent_future_.DispatchNow() and geometry_future_.DispatchNow(). Synchronous event processing can trigger re-entrant window destruction via observers (e.g. Widget::CloseNow()), rendering the current this pointer dangling prior to the remaining member accesses in DispatchEvent.
Potential Trigger Path
- A mouse event is delivered to a top-level
X11WindowW (where the mouse has newly entered). This triggersX11Window::DispatchEvent->MouseOnWindow(W)->W->OnCursorUpdate(). OnCursorUpdatetriggers screen display lookups viaScreenOzone::GetDisplayNearestWindowandX11ScreenOzone::GetDisplayForAcceleratedWidget.GetDisplayForAcceleratedWidgetcallswindow->GetBoundsInPixels()to determine screen coordinates, which delegates togeometry_cache_->GetBoundsPx().GetBoundsPxprocesses pending responses synchronously viaDispatchNow(). Re-entrant callbacks trigger window observers on bounds change, which may synchronously invokeWidget::CloseNow()and destroy W.- Upon unwinding to
X11Window::DispatchEvent, thethispointer is dangling and subsequent member function calls (HandleAsAtkEventorDispatchUiEvent) trigger a browser-process Use-After-Free (UAF).
Note: These are potential steps and our tooling agent does not currently have the capability to run code to confirm this with a fully working PoC.
Suggested Fix
Add a WeakPtr<X11Window> guard in X11Window::DispatchEvent right after MouseOnWindow(this) is called:
uint32_t X11Window::DispatchEvent(const PlatformEvent& event) {
TRACE_EVENT1("views", "X11PlatformWindow::Dispatch", "event->type()",
event->type());
DCHECK_NE(window(), x11::Window::None);
DCHECK(event);
auto& current_xevent = *connection_->dispatching_event();
auto weak_this = weak_ptr_factory_.GetWeakPtr();
if (event->IsMouseEvent()) {
X11WindowManager::GetInstance()->MouseOnWindow(this);
if (!weak_this) {
return POST_DISPATCH_STOP_PROPAGATION;
}
}
#if BUILDFLAG(USE_ATK)
if (HandleAsAtkEvent(current_xevent)) {
return POST_DISPATCH_STOP_PROPAGATION;
}
#endif
DispatchUiEvent(event, current_xevent);
return POST_DISPATCH_STOP_PROPAGATION;
}
Evaluated with Chrome root at commit: 70c6813870b6701fa16670076bf633ee6c3a439f
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 DispatchEvent function calls into code that can synchronously process pending X11 events and destroy the window, without checking afterwards that the window object still exists.
Impact
A browser-process use-after-free could occur, potentially leading to a crash or memory corruption, but the report states it was not confirmed with a working proof of concept.
What the attacker needed
Linux with X11; mouse event on a top-level window; geometry cache not yet ready
The fix
The suggested fix is to add a WeakPtr guard after the MouseOnWindow call and return early if the window has been destroyed.
How it was found
- A mouse event is delivered to a top-level X11Window where the mouse has newly entered.
- DispatchEvent calls MouseOnWindow, which leads to OnCursorUpdate and screen display lookups.
- The display lookup calls GetBoundsInPixels, which processes pending responses synchronously.
- Re-entrant callbacks trigger window observers that may call Widget::CloseNow and destroy the window.
- Control returns to DispatchEvent, which then uses the freed window 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 keeps using a piece of memory after it has been freed. Here, handling a mouse event can cause the window object to be destroyed in the middle of the same function, so later lines touch memory that no longer belongs to the window. The report is a code review finding and says it was not confirmed with a working 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.