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

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

Critical View original
  • 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:

C++
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
}
  1. Synchronous Deletion: Inside HandleToplevelConfigureWithOrigin [1], the method UpdateActivationState() 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 in desktop_window_tree_host_platform.cc, handling activation changes can synchronously close and destroy the widget and thereby its owned PlatformWindow (the WaylandToplevelWindow object):

    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() calls SetPlatformWindow(nullptr), which releases and deletes the WaylandToplevelWindow object.

  2. Use-After-Free: When execution returns to HandleToplevelConfigure [2], this has already been deleted. The method then proceeds to call UpdateSessionStateIfNeeded(), which dereferences members of the deleted object (such as xdg_toplevel_ or session_ 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:

  1. The attacker (or a compromised renderer) causes a state change that makes the Wayland compositor send an xdg_toplevel.configure event.
  2. The xdg_toplevel configure event is processed by XdgToplevel::OnToplevelConfigure, which calls HandleToplevelConfigure.
  3. The configure flow notifies the delegate of an activation state change.
  4. An observer responding to the activation change synchronously calls Widget::CloseNow(), which immediately deletes the WaylandToplevelWindow object.
  5. The stack unwinds back to HandleToplevelConfigure, which calls UpdateSessionStateIfNeeded(), dereferencing the freed this pointer.

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):

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

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 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

  1. Cause a state change so the Wayland compositor sends a toplevel configure event.
  2. The configure event is processed and reaches the toplevel window handler.
  3. The configure flow notifies the delegate of an activation state change.
  4. An observer responding to the activation change synchronously closes the widget, deleting the window object.
  5. 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.

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.