Use after free in UI (CVE-2026-15777)
A use-after-free was identified in Chromium's Linux/X11 drag-and-drop code: if a drop handler spins a nested message loop, a queued window-close task can free both the window and its drag-drop client while they are still on the call stack. Returning from the nested loop then touches freed memory, which the report says could allow remote code execution or sandbox escape in the browser process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 6 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 the Linux/X11 drag-and-drop implementation when XDragDropClient and X11Window are co-destroyed during a nested run loop. If a drag-and-drop callback spins a nested message loop, a deferred window-closure task can execute, freeing both objects. When the nested loop unwinds, subsequent member accesses and virtual function calls on the freed objects lead to a UAF in the browser process.
Affected files:
ui/base/x/x11_drag_drop_client.ccui/ozone/platform/x11/x11_window.ccui/ozone/platform/x11/x11_window.h
Estimated timestamp from git blame: 2020-06-09
Description
A potential Use-After-Free (UAF) vulnerability has been identified in the Linux/X11 drag-and-drop (DnD) target implementation within Chromium.
X11Window both owns XDragDropClient and implements XDragDropClient::Delegate (ui/ozone/platform/x11/x11_window.h). During XDND event handling, XDragDropClient calls into its delegate/drop-handlers to notify the application layer of drag actions (e.g., OnXdndDrop, OnXdndLeave, and CompleteXdndPosition).
If the application-layer drop-handler spins a nested message loop (for instance, showing a file-picker, modal dialog, or utilizing a nested run loop like Exo's DataDevice::PerformDropOrExitDrag in components/exo/data_device.cc), the main thread will pump pending tasks. If a window-close task (CloseNow) was queued, it executes synchronously within this nested loop.
During window close processing, the following destruction chain occurs:
DesktopWindowTreeHostPlatform::CloseNow()callsplatform_window()->Close()(ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc:450).X11Window::Close()executes and invokesplatform_window_delegate_->OnClosed()(ui/ozone/platform/x11/x11_window.cc:524).DesktopWindowTreeHostPlatform::OnClosed()callsSetPlatformWindow(nullptr)(ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc:1053).WindowTreeHostPlatform::SetPlatformWindowresets thestd::unique_ptr<PlatformWindow>, which synchronously invokes~X11Window()and destroys its owneddrag_drop_client_(~XDragDropClient()).DesktopNativeWidgetAura::OnHostClosed()is then called, which executeshost_.reset(), destroyingDesktopWindowTreeHostPlatformitself.
Once the nested run loop unwinds and execution returns to the outer stack frames of X11Window::PerformDrop and XDragDropClient::OnXdndDrop, both objects are accessed on the stack via raw this pointers. This results in UAF member writes (e.g., notified_enter_ = false at ui/ozone/platform/x11/x11_window.cc:1807) and a virtual call to SendXClientEvent on a freed allocation (ui/base/x/x11_drag_drop_client.cc:446), presenting a high-severity RCE/Sandbox Escape risk within the unsandboxed browser process.
Note: These are potential steps based on source code analysis, as our tooling currently does not have the ability to execute code or run interactive proofs of concept.
Potential Trigger Path
- Prepare a webpage that schedules a window close (e.g., calling
window.close()on a popup window, queuing aCloseNowtask via IPC). - Deliver an XDND sequence (e.g.,
XdndEnter->XdndPosition->XdndDrop) to the target window. An attacker with control over a compromised GPU process could forge this sequence directly over the X11 connection to trigger the flow without user interaction. - The drop handler triggers a delegate callback (such as a modal confirmation or dialog box) that spins a nested, nestable
base::RunLoop. - While running the nested loop, the queued
CloseNowtask is dispatched and executes, synchronously destroying theX11Windowand itsXDragDropClient. - Upon unwinding from the nested loop, a virtual method call to
SendXClientEventis performed on the freedXDragDropClientpointer.
Suggested Fix
To prevent this re-entrancy issue, a liveness check must be implemented before continuing execution after any callback that may spin a nested message loop.
We suggest adding a base::WeakPtrFactory<XDragDropClient> to XDragDropClient (or checking its registration status via XDragDropClient::GetForWindow(xwindow_) to see if this is still alive). Check for liveness and early-return if the object has been destroyed, similar to how this class of re-entrancy is handled on the Wayland side in ui/ozone/platform/wayland/host/wayland_window.cc:951-967:
// Suggested guard pattern in ui/base/x/x11_drag_drop_client.cc
base::WeakPtr<XDragDropClient> alive = weak_factory_.GetWeakPtr();
DragOperation drag_operation = delegate_->PerformDrop();
if (!alive) {
return;
}
Evaluated with Chrome root at commit: 84065d9121f6e48f67755f0ae963cc09617e5c85
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 drop-handling code calls into application callbacks that can pump a nested message loop without checking afterwards whether the window and drag-drop client were destroyed during that callback.
Impact
The report claims a high-severity RCE or sandbox escape risk in the unsandboxed browser process, but this is unproven source-code analysis and the trigger may require control of a compromised GPU process.
What the attacker needed
Linux with X11; attacker can send XDND events; possibly a compromised GPU process; drop handler spins a nested loop
The fix
The report suggests adding a weak-pointer liveness check after any callback that may spin a nested loop and returning early if the object was destroyed; it does not say a fix was applied.
How it was found
- Prepare a page that queues a window close, for example closing a popup.
- Send an XDND enter, position and drop sequence to the target window.
- The drop handler runs a callback that spins a nested run loop.
- The queued close task runs inside the nested loop and destroys the window and drag-drop client.
- After the nested loop unwinds, a virtual call is made on the freed drag-drop client.
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 using it, that is a use-after-free: the memory may be reused, so the program reads or writes something unexpected. Here a drag-and-drop handler opens a nested loop (a way of waiting that still processes other pending work), and a pending window-close runs inside it, destroying the objects the outer code is still using. The report is based on reading the source 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.