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

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

A use-after-free was identified in Chromium's Ozone/Wayland tablet tool proximity handling, where a synchronous event dispatch can start a nested message loop during which the target window is destroyed. The dangling raw pointer is then used for virtual calls, which the report says could lead to unsandboxed browser process compromise, though no proof-of-concept was executed.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 19 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 of Chromium on Linux Wayland. Re-entrant event dispatching during tablet tool proximity changes can trigger a nested message loop, during which the target window may be destroyed, leaving a dangling raw pointer. Subsequent virtual function calls on this pointer can lead to an unsandboxed browser process compromise.

Affected files:

  • ui/ozone/platform/wayland/host/wayland_event_source.cc
  • ui/ozone/platform/wayland/host/wayland_window.h
  • ui/ozone/platform/wayland/host/wayland_tablet_tool.cc

Estimated timestamp from git blame: 2025-06-27

Description

A potential Use-After-Free (UAF) vulnerability has been identified in WaylandEventSource::OnTabletToolProximityIn within the Ozone/Wayland implementation. The issue arises because the function uses a raw pointer to a WaylandWindow after performing a synchronous operation that can trigger a nested message loop.

Technical Analysis

The vulnerability is located in ui/ozone/platform/wayland/host/wayland_event_source.cc:

C++
void WaylandEventSource::OnTabletToolProximityIn(WaylandWindow* window,
                                                 const gfx::PointF& location,
                                                 const PointerDetails& details,
                                                 base::TimeTicks time) {
  WaylandWindow* old_focus = tablet_tool_focused_window_.get();
  if (old_focus && old_focus != window) {
    OnTabletToolProximityOut(time);          // [1]
  }
  tablet_tool_focused_window_ = window->AsWeakPtr();   // [2]
  ...
  SetTargetAndDispatchEvent(&event, window);           // [3]
}
  1. Re-entrancy [1]: When focus changes, OnTabletToolProximityOut dispatches a kMouseExited event to the previous window. In Chromium, synchronous event dispatch can trigger a nested message loop (e.g., via a modal dialog or context menu).
  2. Object Destruction: Many nested loops in the Wayland backend are started with kNestableTasksAllowed. While the loop is running, the browser process can process a window close request (e.g., initiated by a renderer via window.close()). This results in the destruction of the WaylandWindow object.
  3. Use-After-Free [2, 3]: When the nested loop returns, execution proceeds to line 590 [2]. The code calls window->AsWeakPtr(). Since AsWeakPtr is a pure virtual function in WaylandWindow, this is a virtual call on a potentially freed object. Further usage at SetTargetAndDispatchEvent [3] results in additional virtual calls (e.g., target->GetParentTarget()).

Because the window pointer is a function parameter on the stack, MiraclePtr (BackupRefPtr) does not provide protection here, as it primarily targets class members of type raw_ptr<>.

Potential Attack Scenario

  1. The attacker convinces a user to visit a malicious site on a Linux Wayland system with a graphics tablet.
  2. The site opens a popup (Window B).
  3. The attacker ensures the main window (Window A) will trigger a nested loop (e.g., a modal dialog) on a MouseExited event.
  4. The attacker triggers a tablet proximity event for Window B while Window A has focus.
  5. OnTabletToolProximityIn calls OnTabletToolProximityOut, triggering the nested loop in Window A.
  6. While the loop is active, the renderer closes Window B.
  7. The browser returns from the loop and dereferences the dangling raw pointer to Window B.

Note: These steps are based on source code analysis; no functional proof-of-concept has been executed by our automated tools.

Suggested Fix

The function should verify the continued existence of the window after the synchronous call. This can be achieved by using a WeakPtr for the window parameter or by re-retrieving the window state after OnTabletToolProximityOut returns.

C++
  base::WeakPtr<WaylandWindow> window_weak = window->AsWeakPtr();
  if (old_focus && old_focus != window) {
    OnTabletToolProximityOut(time);
  }
  if (!window_weak) {
    return;
  }

Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e


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

The function uses a raw window pointer after a synchronous call that can run a nested message loop and destroy that window, and the pointer is a stack parameter so MiraclePtr does not protect it.

Impact

The report claims this could lead to an unsandboxed browser process compromise, but it is based on source code analysis only and no functional proof-of-concept was executed.

What the attacker needed

Linux Wayland system; a graphics tablet attached; victim visits a malicious site; popup allowed

The fix

The function should check that the window still exists after the synchronous call, for example by holding a weak pointer and returning if it is gone.

How it was found

  1. The attacker convinces a user on a Linux Wayland system with a graphics tablet to visit a malicious site.
  2. The site opens a popup window.
  3. The attacker arranges for the main window to start a nested loop on a mouse-exit event.
  4. The attacker triggers a tablet proximity event for the popup while the main window has focus.
  5. While the nested loop runs, the renderer closes the popup window.
  6. The browser returns from the loop and dereferences the dangling pointer.

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, this is called a use-after-free. Here, handling a graphics tablet event can pause to run other code, and during that pause the window object can be closed and freed, so the later use touches memory that no longer belongs to it. Because this happens in the browser's own process, the report suggests it could be serious, but it was found by reading code and not demonstrated.

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.