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

Use after free in Ozone (CVE-2026-13786)

A use-after-free flaw exists in Chromium's Ozone Wayland backend where subclass methods call a base class function that can synchronously destroy the platform window, then continue to access freed memory. An attacker could potentially exploit this memory corruption to achieve remote code execution in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 33 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 vulnerability exists in the Ozone Wayland platform backend of Chromium. When modifying window bounds, the base class execution can synchronously trigger state updates that destroy the platform window. The subclass implementations of SetBoundsInDIP do not perform a liveness check upon returning from the base class, leading to subsequent member access and virtual method calls on the freed instance.

Affected files:

  • ui/ozone/platform/wayland/host/wayland_popup.cc
  • ui/ozone/platform/wayland/host/wayland_bubble.cc

Estimated timestamp from git blame: Unknown (Google3 checkout)

Description

A potential Use-After-Free (UAF) vulnerability has been identified in Chromium's Ozone Wayland backend within the WaylandPopup and WaylandBubble classes. When window bounds are modified via SetBoundsInDIP(), the base-class call WaylandWindow::SetBoundsInDIP can synchronously notify observers of state updates. If an observer triggers widget or window destruction, the underlying platform window is synchronously deleted. Upon returning from the base-class call, the subclass implementations do not perform any liveness checks and continue executing, which results in reads, writes, and virtual method calls on the freed object.

Potential Root Cause Analysis

In ui/ozone/platform/wayland/host/wayland_popup.cc:

C++
void WaylandPopup::SetBoundsInDIP(const gfx::Rect& bounds_dip) {
  auto* xdg_parent_window = GetXdgParentWindow();
  if (!xdg_parent_window) {
    return;
  }

  auto old_bounds_dip = GetBoundsInDIP();
  WaylandWindow::SetBoundsInDIP(bounds_dip);          // May synchronously free `this`

  // Missing liveness check here
  if (xdg_popup_ && old_bounds_dip != bounds_dip) {   // Potential UAF READ
    auto bounds_dip_in_parent =
        wl::TranslateWindowBoundsToParentDIP(this, xdg_parent_window);  // Potential UAF of `this`
    bounds_dip_in_parent.Inset(
        delegate()->CalculateInsetsInDIP(GetPlatformWindowState()));    // Virtual call on freed delegate
    ...

Similarly, in ui/ozone/platform/wayland/host/wayland_bubble.cc:

C++
void WaylandBubble::SetBoundsInDIP(const gfx::Rect& bounds_dip) {
  auto old_bounds_dip = GetBoundsInDIP();
  WaylandWindow::SetBoundsInDIP(bounds_dip); // May synchronously free `this`

  // Missing liveness check here
  if (subsurface_ && old_bounds_dip != bounds_dip) { // Potential UAF READ
    SetSubsurfacePosition();
  }
}

The base class implementation WaylandWindow::MaybeApplyLatestStateRequest notifies delegates of state changes via delegate()->OnStateUpdate(old, latest.state). Under certain widget closure flows, the delegate handles the bounds update and synchronously destroys the platform window. Although the base class includes a weak_this liveness check to safely abort (ui/ozone/platform/wayland/host/wayland_window.cc), control returns directly to the subclass overridden methods which proceed to reference invalid members.

Potential Trigger Path

  1. An interaction (such as programmatically resizing, hovering to trigger a tooltip, or opening/positioning a popup context menu) is initiated.
  2. The views framework triggers a bounds change via WaylandPopup::SetBoundsInDIP or WaylandBubble::SetBoundsInDIP.
  3. The function delegates to WaylandWindow::SetBoundsInDIP, which requests a state change from the client side and synchronously applies it.
  4. During state application, delegate()->OnStateUpdate is called, notifying observers.
  5. An observer synchronously closes/destroys the widget, leading to the destruction of the underlying platform window.
  6. Control unwinds back to the subclass SetBoundsInDIP function, which attempts to access deallocated member pointers and invoke virtual functions on this.

Note: Since our tooling agent does not have the ability to run functional exploit code, these steps and consequences represent potential execution paths derived from static analysis of the codebase.

Impact

This issue occurs in the unsandboxed browser process on Linux platforms using Wayland. If successfully exploited, the resulting memory corruption could allow an attacker to achieve Remote Code Execution (RCE) in the context of the browser process or escape the renderer sandbox.

Suggested Fix

Both WaylandPopup and WaylandBubble implement AsWeakPtr(). Introduce a weak-pointer liveness check immediately after invoking the base class WaylandWindow::SetBoundsInDIP in both subclass implementations:

C++
  auto weak_this = AsWeakPtr();
  WaylandWindow::SetBoundsInDIP(bounds_dip);
  if (!weak_this) {
    return;
  }

Evaluated with Chrome root at commit: fb72408a8493c46bc75fae1c70d03daec96b3040


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

The subclass SetBoundsInDIP methods call the base class implementation, which can synchronously destroy the platform window via observer callbacks, but they do not check whether the object is still alive before accessing members or making virtual calls.

Impact

If successfully exploited, the memory corruption could allow an attacker to achieve remote code execution in the unsandboxed browser process on Linux Wayland platforms, or escape the renderer sandbox.

What the attacker needed

Linux platform using Wayland; attacker can trigger window bounds change; observer destroys widget synchronously

The fix

The fix should add a weak-pointer liveness check immediately after calling the base class SetBoundsInDIP in both subclass implementations.

How it was found

  1. An interaction such as resizing, hovering for a tooltip, or opening a popup menu is initiated.
  2. The views framework triggers a bounds change via WaylandPopup::SetBoundsInDIP or WaylandBubble::SetBoundsInDIP.
  3. The function delegates to WaylandWindow::SetBoundsInDIP, which requests and synchronously applies a state change.
  4. During state application, delegate()->OnStateUpdate is called, notifying observers.
  5. An observer synchronously closes or destroys the widget, destroying the underlying platform window.
  6. Control returns to the subclass SetBoundsInDIP, which accesses deallocated members and invokes virtual functions 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.

A use-after-free happens when a program frees an object's memory but then keeps using it, like deleting a file and still trying to read it. Here, a function that changes window size can trigger a chain of events that deletes the window object, but the code that called it does not check if the object still exists and keeps using it. This can let an attacker run their own code on the victim's computer.

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.