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

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

A use-after-free was reported in the window manager code that propagates visibility changes to transient child windows. Hiding a child could synchronously destroy the parent window and free the manager object, after which the code reads and writes members of the freed object, potentially allowing memory corruption in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 16 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 TransientWindowManager::OnWindowVisibilityChanged due to a lack of liveness verification after propagating visibility updates to transient children. Hiding a transient child window can trigger synchronous destruction of its parent window, which in turn deallocates the owned TransientWindowManager instance. Subsequent member reads and writes on the freed manager can result in a Use-After-Free in the browser process.

Affected files:

  • ui/wm/core/transient_window_manager.cc
  • ui/wm/core/transient_window_manager.h

Estimated timestamp from git blame: 2014-11-12

Root Cause Analysis

In ui/wm/core/transient_window_manager.cc, the method TransientWindowManager::OnWindowVisibilityChanged propagates visibility changes to transient children:

C++
// ui/wm/core/transient_window_manager.cc:236-268
void TransientWindowManager::OnWindowVisibilityChanged(Window* window, bool visible) {
  if (window_ != window)
    return;
  ...
  aura::WindowTracker tracker(transient_children_);
  while (!tracker.windows().empty())
    GetOrCreate(tracker.Pop())->UpdateTransientChildVisibility(visible); // Hides/shows children

  // NO liveness check for |this| before accessing member variables
  if (ignore_visibility_changed_event_ ||
      !transient_parent_ || !parent_controls_visibility_) {
    return;
  }
  ...
}

TransientWindowManager is owned by aura::Window (the parent window window_) as a window property (kPropertyKey defined with DEFINE_OWNED_UI_CLASS_PROPERTY_KEY). Therefore, when the parent window_ is destroyed, its property is cleared, destroying the TransientWindowManager instance synchronously.

During the child-update loop at line 247, hiding a transient child window can trigger synchronous destruction of the parent window (for example, if a child popup/bubble loses focus or capture, triggering associated handlers that close the parent widget). When the parent window is destroyed, its TransientWindowManager (this) is freed. When control returns from the loop, line 254 unconditionally accesses members of the freed TransientWindowManager instance, leading to a Use-After-Free.

Security Impact

Since this UAF occurs in the browser process, an attacker who is able to manipulate window hierarchy and visibility transitions (e.g., from a compromised renderer process or an untrusted ChromeOS guest Wayland client) could potentially exploit this memory corruption to achieve Remote Code Execution (RCE) in the unsandboxed browser process.

Because the UAF is on the implicit this pointer, standard MiraclePtr protections do not mitigate the vulnerability (the this pointer is a bare C++ pointer on the stack, and MiraclePtr only protects raw_ptr members). This allows an attacker who reallocates the freed block to hijack control flow.

Potential Steps to Trigger

Note: These are potential steps as our tooling does not currently support running code to dynamically verify this flow.:

  1. Construct a transient window hierarchy containing a parent window P and a transient child window C that holds event/mouse capture.
  2. Bind a capture-lost or gesture-cancellation handler to C (or its widget) that closes/destroys P's widget synchronously upon capture loss.
  3. Hide P, which dispatches a visibility update through TWM(P)->OnWindowVisibilityChanged.
  4. The loop updates child visibility by calling C->Hide(), triggering capture release or gesture cleanup on C.
  5. The capture-lost handler synchronously destroys the parent window P. This executes ~Window on P, clearing properties and freeing TWM(P) while TWM(P)::OnWindowVisibilityChanged is still on the stack.
  6. The loop finishes and execution reaches line 254, attempting to read ignore_visibility_changed_event_ and other member variables from the freed TWM(P) memory.

Suggested Fix

To prevent this issue, verify the liveness of this before accessing any member variables after the child-visibility update loop. This can be accomplished by keeping a weak pointer to the manager:

C++
void TransientWindowManager::OnWindowVisibilityChanged(Window* window, bool visible) {
  if (window_ != window)
    return;

  base::WeakPtr<TransientWindowManager> weak_this = weak_factory_.GetWeakPtr();

  aura::WindowTracker tracker(transient_children_);
  while (!tracker.windows().empty())
    GetOrCreate(tracker.Pop())->UpdateTransientChildVisibility(visible);

  if (!weak_this)
    return;

  if (ignore_visibility_changed_event_ ||
      !transient_parent_ || !parent_controls_visibility_) {
    return;
  }
  ...
}

Evaluated with Chrome root at commit: 5a99d0c5d2ec6c066f5131e7868ff637440cc3dc


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 visibility-change handler updates transient children without checking whether the manager object itself was destroyed during that loop, so it later accesses freed members.

Impact

An attacker able to manipulate window hierarchy and visibility, such as from a compromised renderer or an untrusted guest client, could potentially exploit the memory corruption to achieve remote code execution in the unsandboxed browser process; the report notes these steps were not dynamically verified.

What the attacker needed

Ability to shape window hierarchy; child window holds capture; handler destroys parent on capture loss

The fix

The handler should keep a weak pointer to the manager and check it is still alive before touching any members after the child-update loop.

How it was found

  1. Build a parent window with a transient child window that holds mouse or event capture.
  2. Attach a handler to the child that destroys the parent when capture is lost.
  3. Hide the parent so the visibility update runs on the manager.
  4. The loop hides the child, which releases capture and fires the handler.
  5. The handler destroys the parent, freeing the manager while its method is still running.
  6. Execution returns to the loop and reads members of the freed manager.

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 a chunk of memory and then keeps using it, like deleting a file and still reading from it. Here, hiding a small child window could cause its parent window to be closed and destroyed straight away, which also destroys a helper object that was still running code. That leftover code then touches the destroyed object, and an attacker who can control window behaviour might abuse this to 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.