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

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

A raw pointer to the focused Wayland window is cached outside the event dispatch loop, so if the first queued pointer event synchronously destroys that window, later events in the same frame use a dangling pointer. The report claims this yields a reliable double-free in the browser process that could be developed into a sandbox escape.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 46 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 raw pointer to a WaylandWindow is cached across multiple event dispatches in WaylandEventSource::OnPointerFrameEvent. If a window is synchronously closed during dispatch, subsequent events in the same frame will use the dangling pointer, leading to a highly reliable double-free via BackupRefPtr in the browser process.

Affected files:

  • ui/ozone/platform/wayland/host/wayland_event_source.cc

Estimated timestamp from git blame: Unknown (Google3 checkout)

Description

A Use-After-Free (UAF) vulnerability exists in WaylandEventSource::OnPointerFrameEvent within Chromium's Wayland implementation (ui/ozone/platform/wayland/host/wayland_event_source.cc).

The function is responsible for draining the pointer_frames_ queue, which can contain multiple events (e.g., mouse movement and button release) received in a single Wayland protocol frame. It incorrectly caches a raw pointer to the currently focused window (target) outside of the dispatch loop and reuses it without verifying the window's liveness.

C++
void WaylandEventSource::OnPointerFrameEvent() {
  // ...
  auto* target = window_manager_->GetCurrentPointerFocusedWindow();
  if (!target) {
    return;
  }

  while (!pointer_frames_.empty()) {
    auto pointer_frame = std::move(pointer_frames_.front());
    pointer_frames_.pop_front();

    SetTargetAndDispatchEvent(pointer_frame->event.get(), target);
    if (!pointer_frame->completion_cb.is_null()) {
      std::move(pointer_frame->completion_cb).Run();
    }
  }
}

During the execution of SetTargetAndDispatchEvent, an event is dispatched to the UI system. This dispatch can trigger synchronous window destruction (e.g., closing a dropdown popup or menu widget that uses WIDGET_OWNS_NATIVE_WIDGET). If the window is destroyed during the first iteration of the loop, the target pointer becomes dangling. In subsequent iterations, SetTargetAndDispatchEvent is called with this dangling pointer.

Exploitation and Impact

This UAF occurs in the Browser process and can be leveraged into a highly reliable double-free primitive, leading to a potential Sandbox Escape.

Suggested potential steps for an attacker to trigger the vulnerability:

  1. The attacker controls a malicious web page that convinces a user to interact with a native UI element backed by a WaylandWindow (e.g., a native <select> dropdown menu or context menu).
  2. The user interaction triggers multiple Wayland pointer events within a single display frame (e.g., moving the mouse while releasing a click generates wl_pointer.button, wl_pointer.motion, and wl_pointer.frame).
  3. Because the standard dispatch policy is wl::EventDispatchPolicy::kOnFrame, the button and motion events are queued in pointer_frames_.
  4. When wl_pointer.frame arrives, OnPointerFrameEvent() begins to drain the queue.
  5. The first event (button release) is dispatched to the target window. This click causes the popup widget to close synchronously, destroying the WaylandWindow.
  6. The WaylandWindow memory is freed by PartitionAlloc. During this free, BackupRefPtr (BRP) clears the kMemoryHeldByAllocatorBit in the slot's metadata.
  7. The while loop continues to the next event (the motion event). SetTargetAndDispatchEvent is called with the dangling target pointer.
  8. Inside SetTargetAndDispatchEvent, the dangling pointer is assigned to the event's raw_ptr<EventTarget> target_ field. This triggers BRP's AcquireInternal(), which increments the reference count on the already-freed slot's metadata.
  9. When the event is destroyed at the end of the loop iteration, the raw_ptr destructor calls ReleaseInternal().
  10. ReleaseInternal() decrements the reference count back to 0. It then checks if the memory is held by the allocator (count & kMemoryHeldByAllocatorBit). Because this bit was cleared during the initial free (Step 6), BRP mistakenly believes it should free the object from quarantine.
  11. PartitionRoot::FreeAfterBRPQuarantine is called, which places the already-freed slot into the PartitionAlloc thread cache again.
  12. This creates a cyclic/corrupted freelist (Double-Free), allowing the attacker to spray the heap, overlap objects, and hijack execution flow in the browser process.

(Note: These are suggested steps based on static analysis; our tooling agent does not yet execute code to provide a working PoC).

Suggested Fix

Similar functions in the same file correctly handle this scenario by using base::WeakPtr (e.g., OnPointerButtonEvent and ReleasePressedPointerButtons). OnPointerFrameEvent should be updated to use a WeakPtr for the target window and check for its validity before each dispatch:

C++
  auto* target_window = window_manager_->GetCurrentPointerFocusedWindow();
  if (!target_window) {
    return;
  }
  base::WeakPtr<WaylandWindow> target = target_window->AsWeakPtr();

  while (!pointer_frames_.empty()) {
    auto pointer_frame = std::move(pointer_frames_.front());
    pointer_frames_.pop_front();

    if (target) {
      SetTargetAndDispatchEvent(pointer_frame->event.get(), target.get());
    }
    // ...

Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb


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 function caches the focused window as a raw pointer before the dispatch loop and never re-checks whether the window still exists after each event is dispatched.

Impact

The report claims a highly reliable double-free in the browser process that could lead to a sandbox escape, though the steps are from static analysis and no working proof of concept was produced.

What the attacker needed

User interacts with a native UI element; Wayland display server session; several pointer events in one frame

The fix

The function should hold the target window as a weak pointer and check it is still valid before each dispatch, as neighbouring functions in the same file already do.

How it was found

  1. The attacker's page gets the user to interact with a native UI element such as a dropdown or context menu.
  2. The interaction produces several pointer events in one display frame, which are queued.
  3. When the frame event arrives, the queue is drained and the first event closes the popup, destroying the window.
  4. The loop continues and dispatches the next event using the freed window pointer.
  5. The allocator's reference counting is confused and the same memory is freed again, corrupting the freelist.

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 a pointer to it and later uses that pointer, it is called a use-after-free. Here the browser remembers which window the mouse is over, then handles several mouse events in a row; if the first event closes that window, the remaining events still refer to the freed window. The report argues this confuses the memory allocator into freeing the same block twice, which an attacker could abuse.

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.