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

Use after free in Aura (CVE-2026-19149)

A use-after-free was reported in the browser process on Linux/X11: querying the display id during a display metric change can synchronously dispatch X11 events that destroy the window host and its compositor. The code then reads and writes to the freed objects, which the report says could allow control-flow hijacking in the unsandboxed browser process.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 51 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 browser process on Linux/X11 platforms during display metric updates. Under Ozone/X11, a call to GetDisplayId() can synchronously dispatch X11 events and lead to the reentrant destruction of the WindowTreeHost object. Subsequent evaluations within the same expression and calls to the associated compositor access and write to freed memory.

Affected files:

  • ui/aura/window_tree_host.cc
  • ui/ozone/platform/x11/x11_window.cc
  • ui/compositor/compositor.cc

Estimated timestamp from git blame: 2025-03-06

Root Cause Analysis

In ui/aura/window_tree_host.cc, the method WindowTreeHost::OnDisplayMetricsChanged is responsible for handling display updates. On the DISPLAY_METRIC_COLOR_SPACE branch, it evaluates GetDisplayId() inside a short-circuiting if statement:

C++
// ui/aura/window_tree_host.cc:648-653
void WindowTreeHost::OnDisplayMetricsChanged(const display::Display& display,
                                             uint32_t metrics) {
  if (metrics & DisplayObserver::DISPLAY_METRIC_COLOR_SPACE && compositor_ &&
      display.id() == GetDisplayId() && !display_color_spaces_) { 
    compositor_->SetDisplayColorSpaces(display.GetColorSpaces()); 
  }

On Linux/X11, GetDisplayId() delegates through ScreenOzone to X11ScreenOzone::GetDisplayForAcceleratedWidget, which retrieves window bounds (ui/ozone/platform/x11/x11_screen_ozone.cc:137-138):

C++
return GetDisplayForRect(GetAllDisplays(), window->GetBoundsInPixels(), true);

X11Window::GetBoundsInPixels() invokes geometry_cache_->GetBoundsPx() (ui/ozone/platform/x11/x11_window.cc:620). As documented in the codebase, if the geometry cache is un-ready or has pending requests, querying bounds synchronously dispatches pending X server events using parent_future_.DispatchNow():

C++
// ui/ozone/platform/x11/x11_window.cc:614-617
// Note: geometry_cache_->GetBoundsPx() can dispatch pending X server events
// synchronously, which can trigger window destruction and invalidate `this`.

If the dispatched events trigger window closure (e.g. via layout/widget bounds observers), the WindowTreeHost object and its associated ui::Compositor are synchronously deleted.

When control returns from GetDisplayId() back to the expression chain in OnDisplayMetricsChanged, this has already been freed:

  1. Evaluating !display_color_spaces_ reads from the freed WindowTreeHost instance (UAF read).
  2. The statement compositor_->SetDisplayColorSpaces(...) reads the compositor_ unique pointer from the freed host memory, and invokes SetDisplayColorSpaces on the already-deleted Compositor object.
  3. Inside Compositor::SetDisplayColorSpaces (ui/compositor/compositor.cc:553), updating display_color_spaces_ results in a heap write to the freed Compositor slot. This is followed by a dereference of host_ (ui/compositor/compositor.cc:555), allowing potential control-flow hijacking in the unsandboxed browser process.

Potential Attack Scenario

Note: These are suggested/potential steps of an exploit flow. Our tooling agent does not have the ability to run code or compile a working proof-of-concept.

  1. A compromised GPU process or local same-display client issues a ReparentWindow request against a browser window to put the parent GeometryCache into an un-Ready state with pending futures.
  2. The attacker triggers a display color space change by modifying the root-window _ICC_PROFILE property and altering _NET_WORKAREA properties to dispatch a metric notification.
  3. The browser receives the notification and runs WindowTreeHost::OnDisplayMetricsChanged with DISPLAY_METRIC_COLOR_SPACE.
  4. Mid-expression evaluation, the synchronous bounds-query forces event dispatch, which triggers a bounds-observer that synchronously closes/deletes the WindowTreeHost and its Compositor.
  5. Upon return, the browser process accesses the freed WindowTreeHost and Compositor memory, yielding a Use-After-Free heap write.

Suggested Fix

Guard the metric changes inside WindowTreeHost::OnDisplayMetricsChanged using a base::WeakPtr of the host before performing queries that can cause reentrant deletion, and check its validity before accessing members or invoking the compositor:

C++
void WindowTreeHost::OnDisplayMetricsChanged(const display::Display& display,
                                             uint32_t metrics) {
  if (metrics & DisplayObserver::DISPLAY_METRIC_COLOR_SPACE && compositor_) {
    auto weak_this = GetWeakPtr();
    const int64_t display_id = GetDisplayId();
    if (!weak_this)
      return;
    if (display.id() == display_id && !display_color_spaces_) {
      compositor_->SetDisplayColorSpaces(display.GetColorSpaces());
    }
  }
  // Apply similar WeakPtr guards to subsequent metric branches if necessary.
}

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 reentrancy problem: a getter called inside a condition can synchronously dispatch X11 events that delete the WindowTreeHost and its Compositor, and the remaining expression then uses those freed objects without a lifetime guard.

Impact

The report claims a heap write to freed memory in the unsandboxed browser process, which could potentially allow control-flow hijacking, though no working exploit was built and the scenario is described as suggested and potential.

What the attacker needed

Linux/X11 platform; compromised GPU process or local client; ability to change root-window properties

The fix

The report suggests guarding the handler with a weak pointer to the host, checking it after the display id lookup and before touching members or the compositor.

How it was found

  1. Put the parent geometry cache into a not-ready state with pending requests, for example via a ReparentWindow request from a compromised GPU process or local client.
  2. Trigger a display colour space change by altering root-window properties so a metric notification is dispatched.
  3. The browser runs the display metrics handler for the colour space metric.
  4. During the display id lookup, the synchronous bounds query dispatches events that close and delete the window host and compositor.
  5. On return, the browser reads and writes the freed memory.

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, that memory can be reused, so touching it afterwards is a use-after-free. Here, a routine that handles a screen change asks for the display id, and that question can trigger other events that close and delete the window object. The code then keeps using the deleted object, which can let an attacker influence what the browser does 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.