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

Use after free in Views (CVE-2026-17699)

A use-after-free vulnerability exists in WindowModalityController::OnWindowVisibilityChanged where a modal window's visibility change triggers synchronous touch cancellation events that can destroy the window, leaving a dangling pointer that is then dereferenced. An attacker could potentially exploit this to crash the browser or achieve code execution in the unsandboxed browser process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 2 months

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) exists in WindowModalityController::OnWindowVisibilityChanged in ash-chrome and desktop Aura. When a modal window becomes visible, the controller synchronously dispatches touch cancellation events, which can run arbitrary event handlers and destroy the window. Upon return, the code continues to dereference the potentially freed window pointer without any liveness checks.

Affected files:

  • ui/wm/core/window_modality_controller.cc

Estimated timestamp from git blame: 2018-11-14

Analysis

In ui/wm/core/window_modality_controller.cc, WindowModalityController::OnWindowVisibilityChanged performs multiple operations on a raw aura::Window* pointer without tracking its lifecycle across synchronous event dispatches.

When a modal window is shown, the function calls CancelTouchesOnTransientWindowTree(window):

C++
void WindowModalityController::OnWindowVisibilityChanged(aura::Window* window,
                                                         bool visible) {
  if (visible && window->GetProperty(aura::client::kModalKey) !=
                     ui::mojom::ModalType::kNone) {
    CancelTouchesOnTransientWindowTree(window);

    // Make sure no other window has capture, otherwise |window| won't get mouse
    // events.
    aura::Window* capture_window = aura::client::GetCaptureWindow(window);
...

The call to CancelTouchesOnTransientWindowTree(window) invokes env_->gesture_recognizer()->CancelActiveTouchesOn(blocked_consumers), which synthesizes ET_TOUCH_CANCELLED events and dispatches them synchronously through the Aura event handler chain.

In Aura, it is a known and supported behavior for event handlers to synchronously destroy associated windows or hosts during a touch cancellation dispatch (this is explicitly verified by unit tests such as CancelActiveTouchesUAFWhenHandlerDeletesHost in ui/aura/window_event_dispatcher_unittest.cc, and commented on in aura::Window::CleanupGestureState).

If an event handler synchronously destroys the modal window (or its transient parent, which recursively deletes the child) during this event dispatch, the window pointer is freed. When execution returns to OnWindowVisibilityChanged, the function immediately proceeds to dereference window at:

  • Line 185: aura::client::GetCaptureWindow(window) (which calls window->GetRootWindow())
  • Line 188: window->GetProperty(aura::client::kModalKey)
  • Line 190: GetModalParent(window)

Because window is passed as a raw C++ pointer on the stack, MiraclePtr (BackupRefPtr) does not protect it, resulting in a Use-After-Free (UAF) in the unsandboxed browser/Ash process.

Potential Steps to Trigger

  1. Establish active touches on a window in the transient tree of the browser.
  2. Trigger a modal dialog or visibility change that invokes WindowModalityController::OnWindowVisibilityChanged on a modal window.
  3. Register an event handler (or utilize existing Aura/Widget close paths) that synchronously closes or destroys the window/widget upon receiving the ET_TOUCH_CANCELLED event.
  4. Observe the Use-After-Free crash on the browser's UI thread when OnWindowVisibilityChanged resumes and dereferences the deleted window.

Note: These are potential/suggested steps; our tooling does not currently have the capability to run code or dynamically validate a proof of concept.

Recommended Remediation

Use aura::WindowTracker to verify the liveness of the window across the synchronous touch cancellation call:

C++
void WindowModalityController::OnWindowVisibilityChanged(aura::Window* window,
                                                         bool visible) {
  if (visible && window->GetProperty(aura::client::kModalKey) !=
                     ui::mojom::ModalType::kNone) {
    aura::WindowTracker tracker({window});
    CancelTouchesOnTransientWindowTree(window);
    if (!tracker.Contains(window)) {
      return;
    }

    // Make sure no other window has capture, otherwise |window| won't get mouse
    // events.
    aura::Window* capture_window = aura::client::GetCaptureWindow(window);
...

Evaluated with Chrome root at commit: 5133b93d189b383c37805b1cf3a9d2dbfe8d7379


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 calls CancelTouchesOnTransientWindowTree, which synchronously dispatches events that can destroy the window, and then dereferences the now-dangling window pointer without checking if it is still alive.

Impact

This could lead to a use-after-free in the unsandboxed browser process, potentially allowing an attacker to crash the browser or execute arbitrary code.

What the attacker needed

Active touches on a window; modal window becomes visible; event handler destroys window

The fix

The fix is to use aura::WindowTracker to verify the liveness of the window across the synchronous touch cancellation call and return early if the window has been destroyed.

How it was found

  1. Establish active touches on a window in the transient tree of the browser.
  2. Trigger a modal dialog or visibility change that invokes WindowModalityController::OnWindowVisibilityChanged on a modal window.
  3. Register an event handler that synchronously closes or destroys the window/widget upon receiving the ET_TOUCH_CANCELLED event.
  4. Observe the Use-After-Free crash on the browser's UI thread when OnWindowVisibilityChanged resumes and dereferences the deleted window.

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.

This report describes a memory safety bug in Chrome's window management code. When a pop-up window appears, the code sends out touch-cancel signals, and those signals can cause the window to be closed and its memory freed. The code then tries to use that freed memory, which can crash the browser or 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.