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

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

A use-after-free was identified in Chromium's Ozone/X11 code: handling a MapNotify event can synchronously call Maximize(), which exits fullscreen and notifies observers, allowing an observer to delete the X11Window object while OnWindowMapped() continues to use it. An attacker who can trigger this sequence could cause a crash or potentially exploit the freed memory.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 13 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 Chromium's Ozone/X11 platform code. Handling a MapNotify event can trigger a synchronous call to OnWindowMapped(), which invokes Maximize() and exits fullscreen mode. This transition notifies observers of a bounds change, which can synchronously delete the X11Window object and lead to a UAF upon stack unwinding.

Affected files:

  • ui/ozone/platform/x11/x11_window.cc
  • ui/ozone/platform/x11/x11_window.h

Estimated timestamp from git blame: 2025-03-06

Root Cause Analysis

In ui/ozone/platform/x11/x11_window.cc, X11Window::OnWindowMapped() is invoked to process MapNotify events:

C++
void X11Window::OnWindowMapped() {
  window_mapped_in_server_ = true;
  if (should_maximize_after_map_) {
    Maximize();
    should_maximize_after_map_ = false;      // Potential Use-After-Free write
  }
  if (should_grab_pointer_after_map_) {
    has_pointer_grab_ |= 
        (ui::GrabPointer(xwindow_, true, nullptr) == x11::GrabStatus::Success);
    should_grab_pointer_after_map_ = false;
  }
}

If the window is fullscreen, Maximize() attempts to exit fullscreen mode by calling SetFullscreen(false, ...) (ui/ozone/platform/x11/x11_window.cc:763). At the end of SetFullscreen(), a delegate callback is fired to notify observers of the bounds change:

C++
platform_window_delegate_->OnBoundsChanged({origin_changed});

This delegate call propagates up the stack. An observer responding to this bounds change can synchronously trigger widget closure by invoking views::Widget::CloseNow(). This destroys the Views widget and its native window, synchronously deleting the X11Window instance via DesktopWindowTreeHostPlatform::OnClosed() -> SetPlatformWindow(nullptr).

When the delegate call returns, the execution flow unwinds through SetFullscreen() back to Maximize(). While Maximize() safely returns early because of its weak_this check (ui/ozone/platform/x11/x11_window.cc:764), control is then returned to OnWindowMapped() where no weak_this guard is present. As a result, the statement should_maximize_after_map_ = false; (and potentially the subsequent pointer-grabbing logic) is executed on a freed this pointer context.

Vulnerability Dispatch Path

Unlike translative UI events that go through PlatformEventDispatcher (which has defensive weak_this guards), MapNotify is treated as a non-translative event (EventType::kUnknown). It is routed through the raw EventObserver path: Connection::DispatchEvent() -> X11Window::OnEvent() -> HandleEvent() -> OnWindowMapped(). This path is completely missing any weak_ptr verification checks.

Suggested Steps to Trigger the Potential Vulnerability

Note: These are potential steps; our current analysis is based on static code tracing, and we do not yet have a running proof-of-concept.

  1. Establish a state where should_maximize_after_map_ is set to true (e.g., call Widget::Maximize() while the window is unmapped) and then set the window state to fullscreen (SetFullscreen(true)).
  2. Register an observer (such as a bounds-changed observer) on the widget that will synchronously call Widget::CloseNow() upon receiving the next bounds update.
  3. Deliver a MapNotify event to the target window (either naturally or through a synthetic event using XSendEvent if simulating a compromised GPU process context).
  4. Observe the execution of OnWindowMapped(), where the synchronous destruction occurs during the nested SetFullscreen() call, and the subsequent crash/UAF upon returning to line 2445.

Suggested Fix

To prevent this vulnerability, a weak_this guard should be introduced in X11Window::OnWindowMapped() immediately after invoking Maximize() to safely exit if the window has been synchronously deleted:

C++
void X11Window::OnWindowMapped() {
  window_mapped_in_server_ = true;
  if (should_maximize_after_map_) {
    auto weak_this = weak_ptr_factory_.GetWeakPtr();
    Maximize();
    if (!weak_this) {
      return;
    }
    should_maximize_after_map_ = false;
  }
  ...

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 OnWindowMapped() function lacks a weak-pointer guard after calling Maximize(), so a synchronous observer callback can delete the X11Window object and the function then writes to freed memory.

Impact

The use-after-free could cause a crash and, if the freed memory is reused, may allow an attacker to execute arbitrary code, though the report notes the analysis is static and no proof-of-concept exists yet.

What the attacker needed

Ability to deliver a MapNotify event; window in fullscreen with pending maximise; observer that closes the widget on bounds change

The fix

A weak-pointer guard should be added in OnWindowMapped() immediately after calling Maximize() so the function exits safely if the window has been synchronously deleted.

How it was found

  1. Set should_maximize_after_map_ to true by maximising an unmapped window, then set the window to fullscreen.
  2. Register a bounds-changed observer that synchronously calls Widget::CloseNow() on the next bounds update.
  3. Deliver a MapNotify event to the target window.
  4. Observe the synchronous destruction during SetFullscreen() and the use-after-free when OnWindowMapped() resumes.

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 keeps using a piece of memory after it has been freed. Here, a window event causes the window object to be deleted while the code is still running inside one of its functions, so the next line writes to 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.