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

Use after free in TabStrip (CVE-2026-19557)

On macOS, showing a tab group deletion dialog runs a nested run loop during the sheet animation. If the browser window is closed during this loop, the controller object is freed, and when the function returns it writes to the freed memory, causing a use-after-free write in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 29 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: On macOS, showing a tab group deletion dialog synchronously spins a nested run loop during the sheet animation. If the browser window is closed during this loop, the owning DeletionDialogController is freed, leading to a potential Use-After-Free write when the function returns.

Affected files:

  • chrome/browser/ui/tabs/tab_group_deletion_dialog_controller.cc
  • chrome/browser/ui/tabs/tab_group_deletion_dialog_controller.h

Estimated timestamp from git blame: 2025-06-17

Root Cause Analysis

In chrome/browser/ui/tabs/tab_group_deletion_dialog_controller.cc, DeletionDialogController::CreateDialogFromBrowser() displays a modal dialog and assigns the resulting views::Widget* directly to a member variable:

C++
void DeletionDialogController::CreateDialogFromBrowser(
    BrowserWindowInterface* browser,
    std::unique_ptr<ui::DialogModel> dialog_model) {
  widget_ = chrome::ShowBrowserModal(browser, std::move(dialog_model));
}

On macOS, showing a window-modal dialog synchronous-pathway (for in-process views) routes to NativeWidgetNSWindowBridge::ShowAsModalSheet(), which executes native Cocoa -[NSWindow beginSheet:completionHandler:] on the current call stack. This native Cocoa animation loop blocks the main thread and spins a nested CFRunLoop.

Because the dialog presentation is often initiated by a native UI gesture (such as right-clicking a tab group header on the native event stack), the Thread Controller's task_execution_allowed flag remains true. Consequently, Chromium's message loop is allowed to dispatch pending application tasks during the sheet's slide-in animation.

If a window-close task (e.g. triggered by an extension calling chrome.windows.remove() or a compromised renderer initiating window closure) is executed inside the nested run loop, the main Browser window is destroyed. This synchronously destroys BrowserWindowFeatures and frees the DeletionDialogController instance. When beginSheet: finishes and chrome::ShowBrowserModal returns, the execution resumes inside CreateDialogFromBrowser(). The assignment to this->widget_ is then a Use-After-Free (UAF) write on a deleted this pointer.

Since this is not protected by MiraclePtr/BackupRefPtr (BRP) inside its own member functions, this results in unsandboxed memory corruption in the browser process.


Potential Trigger Steps

Note: These are potential steps and have not been validated in a running environment, as our tooling agent does not have execution capabilities.

  1. A saved tab group is present in the browser window.
  2. The user right-clicks the tab group header and selects "Delete group" (initiating a native NSEvent stack trace).
  3. During the modal sheet slide-in animation, an attacker-controlled extension or a compromised renderer triggers a window-close operation (e.g. via chrome.windows.remove()).
  4. The browser window is closed, synchronously tearing down BrowserWindowFeatures and deleting the DeletionDialogController instance.
  5. The sheet animation loop returns, and CreateDialogFromBrowser() attempts to write the returned Widget* to the deallocated widget_ member, resulting in a heap write UAF.

Suggested Fix

To prevent accessing a deallocated this pointer when returning from the synchronous modal sheet presentation, add a base::WeakPtrFactory to DeletionDialogController and check a local stack-allocated base::WeakPtr before assigning the member variable:

C++
// In tab_group_deletion_dialog_controller.h:
class DeletionDialogController : public TabStripModelObserver {
  ...
 private:
  ...
  base::WeakPtrFactory<DeletionDialogController> weak_ptr_factory_{this};
};
C++
// In tab_group_deletion_dialog_controller.cc:
void DeletionDialogController::CreateDialogFromBrowser(
    BrowserWindowInterface* browser,
    std::unique_ptr<ui::DialogModel> dialog_model) {
  base::WeakPtr<DeletionDialogController> weak_this = weak_ptr_factory_.GetWeakPtr();
  views::Widget* widget = chrome::ShowBrowserModal(browser, std::move(dialog_model));
  if (weak_this) {
    widget_ = widget;
  }
}

Evaluated with Chrome root at commit: b5b015ea5f690560237d1f0cff1405844cd12b8d


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 dialog presentation spins a nested run loop that allows pending tasks to run, and a window-close task can free the controller while the original function is still executing, leading to a write to freed memory.

Impact

A compromised renderer or an attacker-controlled extension could potentially cause unsandboxed memory corruption in the browser process, though the steps have not been validated.

What the attacker needed

MacOS; saved tab group present; attacker-controlled extension or compromised renderer; user right-clicks tab group header

The fix

The suggested fix is to add a base::WeakPtrFactory to DeletionDialogController and check a local weak pointer before assigning the member variable, to avoid accessing a deallocated this pointer.

How it was found

  1. A saved tab group is present in the browser window.
  2. The user right-clicks the tab group header and selects 'Delete group'.
  3. During the modal sheet slide-in animation, an attacker-controlled extension or a compromised renderer triggers a window-close operation.
  4. The browser window is closed, tearing down BrowserWindowFeatures and deleting the DeletionDialogController instance.
  5. The sheet animation loop returns, and CreateDialogFromBrowser() attempts to write the returned Widget* to the deallocated widget_ member.

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 an object but then keeps using it, like deleting a file and then trying to write to it. Here, a dialog animation lets other tasks run, and one of those tasks can close the window and free the dialog's controller. When the animation finishes, the code writes to the now-freed controller, which can corrupt memory.

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.