Skip to content
Memory corruption Advisory Advanced CVE-2026-15777

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.cc
  • ui/ozone/platform/x11/x11_window.cc
  • ui/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:

  1. DesktopWindowTreeHostPlatform::CloseNow() calls platform_window()->Close() (ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc:450).
  2. X11Window::Close() executes and invokes platform_window_delegate_->OnClosed() (ui/ozone/platform/x11/x11_window.cc:524).
  3. DesktopWindowTreeHostPlatform::OnClosed() calls SetPlatformWindow(nullptr) (ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc:1053).
  4. WindowTreeHostPlatform::SetPlatformWindow resets the std::unique_ptr<PlatformWindow>, which synchronously invokes ~X11Window() and destroys its owned drag_drop_client_ (~XDragDropClient()).
  5. DesktopNativeWidgetAura::OnHostClosed() is then called, which executes host_.reset(), destroying DesktopWindowTreeHostPlatform itself.

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

  1. Prepare a webpage that schedules a window close (e.g., calling window.close() on a popup window, queuing a CloseNow task via IPC).
  2. 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.
  3. The drop handler triggers a delegate callback (such as a modal confirmation or dialog box) that spins a nested, nestable base::RunLoop.
  4. While running the nested loop, the queued CloseNow task is dispatched and executes, synchronously destroying the X11Window and its XDragDropClient.
  5. Upon unwinding from the nested loop, a virtual method call to SendXClientEvent is performed on the freed XDragDropClient pointer.

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:

C++
// 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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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

  1. Prepare a page that queues a window close, for example closing a popup.
  2. Send an XDND enter, position and drop sequence to the target window.
  3. The drop handler runs a callback that spins a nested run loop.
  4. The queued close task runs inside the nested loop and destroys the window and drag-drop client.
  5. 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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.