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

Use after free in Views (CVE-2026-17894)

A use-after-free was reported in the Linux/X11 window-centring code: querying the work area can synchronously process pending X11 events, and an observer handling those events may destroy the host. When execution returns, the code reads and calls through the freed host, potentially leading to a wild virtual call in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 43 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 DesktopWindowTreeHostPlatform::CenterWindow on Linux/X11 (Ozone). Querying the work area bounds can transitively dispatch pending X11 events synchronously via GeometryCache, which can trigger host destruction. When execution resumes in CenterWindow, the code dereferences the freed host instance, potentially leading to a wild virtual function call.

Affected files:

  • ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
  • ui/ozone/platform/x11/x11_screen_ozone.cc
  • ui/ozone/platform/x11/x11_window.cc

Estimated timestamp from git blame: 2025-03-06

Root Cause Analysis

In ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc, the function DesktopWindowTreeHostPlatform::CenterWindow executes the following sequence:

C++
void DesktopWindowTreeHostPlatform::CenterWindow(const gfx::Size& size) {
  gfx::Rect parent_bounds = GetWorkAreaBoundsInScreen();   // <-- Potential synchronous deletion sink

  if (wm::GetTransientParent(GetContentWindow())) {        // <-- UAF read of freed |this|
    gfx::Rect transient_parent_rect =
        wm::GetTransientParent(GetContentWindow())->GetBoundsInScreen();
    ...
  }
  ...
  SetBoundsInDIP(window_bounds_in_screen);                 // <-- UAF virtual call on freed |this|
}

When GetWorkAreaBoundsInScreen() is called under Linux/Ozone/X11, it queries the display system which transitively invokes X11Window::GetBoundsInPixels().

If the window was recently created or reparented, the underlying GeometryCache may be un-Ready (i.e., waiting for responses from the X11 server). To resolve this, GeometryCache::GetBoundsPx() synchronously dispatches the pending futures via DispatchNow() to process incoming server replies. This runs the message loop synchronously.

Processing these events can trigger bounds-change notifications, causing registered WindowTreeHostObservers to run. If an observer synchronously closes the widget/host (e.g., during complex layout recalculations or window-snapping events), the DesktopWindowTreeHostPlatform instance is deleted via host_.reset(). When control returns to CenterWindow(), execution continues using the now-freed this pointer, causing a Use-After-Free read on desktop_native_widget_aura_ followed by a virtual method call on SetBoundsInDIP through a hijacked vtable pointer.

Potential Trigger Path

Note: The following are suggested/potential steps to trigger the behavior, as our tooling does not currently have the capability to run code to confirm live execution:

  1. From the renderer or browser UI, trigger the initialization of a top-level widget/dialog with default or empty bounds on Linux/X11.
  2. The window is initialized, and Widget::SetInitialBounds calls CenterWindow() before the X server has replied to the window geometry queries.
  3. The synchronous DispatchNow() loop is entered within GeometryCache::GetBoundsPx() to retrieve the geometry replies.
  4. An event handler or observer intercepts the bounds change and immediately calls Widget::CloseNow(), which synchronously deletes the DesktopWindowTreeHostPlatform host container.
  5. Control flow returns to CenterWindow(), resulting in a browser-process UAF.

MiraclePtr Status

This UAF is not protected by MiraclePtr. The dangling pointer is the implicit stack this pointer (not a raw_ptr<>). The member field desktop_native_widget_aura_ resides inside the freed DesktopWindowTreeHostPlatform allocation, so reading it is a UAF on the storage itself rather than a BRP-quarantined reference.

Suggested Fix

Add a base::WeakPtr guard in DesktopWindowTreeHostPlatform::CenterWindow to safely abort execution if the host is synchronously destroyed during the bounds query:

C++
void DesktopWindowTreeHostPlatform::CenterWindow(const gfx::Size& size) {
  base::WeakPtr<DesktopWindowTreeHostPlatform> weak_this = weak_factory_.GetWeakPtr();
  gfx::Rect parent_bounds = GetWorkAreaBoundsInScreen();
  if (!weak_this) {
    return;
  }

  if (wm::GetTransientParent(GetContentWindow())) {
    ...

Evaluated with Chrome root at commit: 75203b87cbf6681eb7c7dda8e1d0bf781538c76a


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 a re-entrant synchronous event dispatch during a geometry query allows an observer to destroy the host, and the caller continues using its dangling this pointer without a lifetime guard.

Impact

The report claims a browser-process use-after-free that could potentially lead to a wild virtual function call, but the trigger path is unconfirmed and the text does not demonstrate exploitation.

What the attacker needed

Linux with X11/Ozone; window recently created or reparented; observer closes widget on bounds change

The fix

The report suggests guarding CenterWindow with a weak pointer so execution aborts if the host was destroyed during the bounds query; it does not say a fix was applied.

How it was found

  1. Trigger a top-level widget or dialog with default or empty bounds on Linux/X11.
  2. CenterWindow runs before the X server has replied to geometry queries.
  3. The geometry cache synchronously dispatches pending replies.
  4. An observer reacts to the bounds change and closes the widget immediately.
  5. Control returns to CenterWindow, which uses the freed host.

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. Here, asking the window system for screen geometry can run other code in the middle, and that code may close and delete the window object; the original function then keeps working with the deleted object. Because the deleted object's memory can be reused, an attacker might influence what code runs next.

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.