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

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

A use-after-free vulnerability exists in the headless Ozone window implementation because synchronous delegate callbacks can cause the window to be destroyed while its methods are still running. An attacker could potentially trigger a state change that leads to memory corruption and a virtual function call on freed memory in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 14 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 ui::HeadlessWindow due to synchronous delegate callbacks during state-changing operations. If an observer synchronously closes the widget during these callbacks, the underlying HeadlessWindow is deleted while its methods are still executing on the stack. Subsequent execution leads to UAF member accesses and a virtual function call in the browser process.

Affected files:

  • ui/ozone/platform/headless/headless_window.cc
  • ui/ozone/platform/headless/headless_window.h

Estimated timestamp from git blame: 2023-09-29

Root Cause

In ui/ozone/platform/headless/headless_window.cc, multiple state-changing operations such as SetFullscreen(), Maximize(), Minimize(), and Restore() invoke delegate callbacks synchronously (e.g., delegate_->OnBoundsChanged() via UpdateBounds()). These callbacks propagate up to observers (such as WidgetObserver or WindowTreeHostObserver), which can synchronously close and destroy the widget and window via Widget::CloseNow() under certain application states.

Because HeadlessWindow lacks any base::WeakPtrFactory or liveness checks, it is vulnerable to being deleted while its methods are still active on the call stack.

Potential Call Stack and Destruction Sequence

When a widget is closed during a bounds-changed or state-changed notification, the destruction sequence proceeds as follows:

  1. ui::HeadlessWindow::SetFullscreen() calls ZoomWindowBounds(), which calls UpdateBounds(), which synchronously invokes delegate_->OnBoundsChanged().
  2. This propagates through WindowTreeHostPlatform::OnBoundsChanged() and DesktopNativeWidgetAura::OnHostResized(), calling Widget::OnNativeWidgetSizeChanged().
  3. A registered observer synchronously calls Widget::CloseNow().
  4. This delegates to DesktopWindowTreeHostPlatform::CloseNow(), which calls platform_window()->Close().
  5. HeadlessWindow::Close() synchronously calls delegate_->OnClosed(), resulting in a call to SetPlatformWindow(nullptr) inside DesktopWindowTreeHostPlatform::OnClosed().
  6. SetPlatformWindow(nullptr) resets the unique pointer owning the HeadlessWindow, synchronously destroying it.
  7. The call stack unwinds back to HeadlessWindow::SetFullscreen(), which proceeds to execute UpdateWindowState(PlatformWindowState::kFullScreen) on the now-freed this pointer.
  8. Inside UpdateWindowState(), the code attempts a write to window_state_ and a virtual call on delegate_ (which is also a dangling pointer or reclaimed memory).

Suggested / Potential Steps to Reproduce

Note: These are potential steps based on source code analysis; our tooling does not currently support running code to verify this dynamically.

  1. Run Headless Chrome (--headless) on Linux with Ozone.
  2. Trigger a state change (such as fullscreen via element.requestFullscreen()) from a renderer process or headless test script.
  3. Register an observer (e.g., a custom WidgetObserver or layout observer) that responds to the resulting bounds change by synchronously calling Widget::CloseNow().
  4. Observe the Use-After-Free condition when control returns to the call stack of HeadlessWindow::SetFullscreen() and attempts to access window_state_ or invoke delegate_->OnWindowStateChanged().

Proposed Fix

Add a base::WeakPtrFactory<HeadlessWindow> member to HeadlessWindow. Guard any call sites that invoke delegate methods synchronously by taking a weak pointer first, and verifying its liveness before accessing any member variables or calling subsequent helper functions.

For example, in ui/ozone/platform/headless/headless_window.cc:

C++
void HeadlessWindow::SetFullscreen(bool fullscreen, int64_t target_display_id) {
  DCHECK_EQ(target_display_id, display::kInvalidDisplayId);
  if (!delegate_->CanFullscreen()) {
    return;
  }

  auto weak_this = weak_ptr_factory_.GetWeakPtr();
  if (fullscreen) {
    if (window_state_ != PlatformWindowState::kMaximized &&
        window_state_ != PlatformWindowState::kFullScreen) {
      restored_bounds_ = bounds_;
    }
    ZoomWindowBounds();
    if (!weak_this) {
      return;
    }
    UpdateWindowState(PlatformWindowState::kFullScreen);
  } else {
    if (window_state_ != PlatformWindowState::kFullScreen) {
      return;
    }
    RestoreWindowBounds();
    if (!weak_this) {
      return;
    }
    UpdateWindowState(PlatformWindowState::kNormal);
  }
}

Evaluated with Chrome root at commit: a2bea94528f4bd6cc57739c43fa3bb890b8367d3


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 lack of a weak pointer or liveness check in HeadlessWindow allows synchronous delegate callbacks to destroy the object while its methods are still on the call stack.

Impact

This could lead to memory corruption and a virtual function call on freed memory in the browser process, potentially allowing code execution, though the report notes the steps are unverified.

What the attacker needed

Headless Chrome on Linux with Ozone; Ability to trigger a state change; An observer that closes the widget synchronously

The fix

The suggested fix is to add a base::WeakPtrFactory to HeadlessWindow and check liveness after synchronous delegate calls before accessing members.

How it was found

  1. Run Headless Chrome on Linux with Ozone.
  2. Trigger a state change such as fullscreen from a renderer or test script.
  3. Register an observer that synchronously calls Widget::CloseNow() on the bounds change.
  4. Observe the use-after-free when control returns to SetFullscreen().

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 memory but then keeps using it, like deleting a file and then trying to open it. Here, a window can be closed and destroyed in the middle of a function that is still running, so the function later touches memory that no longer belongs to it. This can crash the browser or, in theory, let an attacker run their own 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.