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

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

A use-after-free in macOS tooltip handling leaves a dangling pointer after a view is detached, which a compromised renderer can trigger via tooltip IPC messages. This could lead to remote code execution in the browser process, potentially escaping the sandbox.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 41 days

Flapjack, 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 without the Chrome Security team. Please see go/chrome-ai-generated-security-bugs-faq for more information.

Overview: A Use-After-Free (UAF) in macOS tooltips can potentially be exploited by a compromised renderer. When a view is detached, tooltip cleanup fails to clear an internal pointer, which can later be dereferenced when the renderer sends a malicious tooltip update.

Affected files:

  • ui/base/cocoa/tool_tip_base_view.mm

Estimated timestamp from git blame: 2015-05-19

Description

A Use-After-Free (UAF) vulnerability exists in ui/base/cocoa/tool_tip_base_view.mm on macOS. ToolTipBaseView caches a raw pointer (_trackingRectUserData) to an internal AppKit NSToolTip struct. When a view is detached from its window and the tooltip is removed, the _trackingRectUserData pointer is not cleared, leaving it dangling. A compromised renderer can force the dereference of this dangling pointer by sending subsequent tooltip update IPC messages, potentially leading to a Sandbox Escape in the Browser process.

Technical Details

  1. Allocation: When a standard tooltip is displayed, AppKit allocates an NSToolTip struct and calls the overridden addTrackingRect:... method on ToolTipBaseView (or a subclass like RenderWidgetHostViewCocoa). Chromium caches a pointer to this struct in _trackingRectUserData.
  2. Detachment: The view is detached from its NSWindow (e.g., during tab tearing or window closure), so self.window becomes nil.
  3. Removal: The tooltip is removed (either automatically or triggered by setToolTipAtMousePoint:). AppKit calls the overridden removeTrackingRect: or _removeTrackingRects:count:. These methods correctly set _trackingRectOwner to nil but fail to clear _trackingRectUserData. AppKit then frees the NSToolTip memory, leaving _trackingRectUserData dangling.
  4. Malicious Update: A compromised renderer sends a SetTooltipText (or UpdateTooltipUnderCursor) IPC message with a non-empty string. (Note: For some views, like Top Chrome WebUI, the bridge check only requires the app to be active, not the window to be valid).
  5. Execution Path: The browser routes this to -[ToolTipBaseView setToolTipAtMousePoint:].
    • It first calls [self removeAllToolTips].
    • It then attempts to add the new tooltip. Because self.window is nil, AppKit defers tracking rect creation and bypasses addTrackingRect:, leaving the dangling _trackingRectUserData untouched.
    • It then calls _sendToolTipMouseEntered. If the mouse is over the desktop, a safety check (windowNumberAtPoint) evaluates to 0, matching self.window.windowNumber (which is also 0), and bypasses the check. Otherwise, the attacker can send a second IPC update, triggering _sendToolTipMouseExited, which completely lacks a window check.
  6. UAF: Both paths construct a fake NSEvent using the dangling _trackingRectUserData and dispatch it to NSToolTipManager. AppKit dereferences the freed memory.
  7. Exploitation: Because NSToolTip is an AppKit struct, it is allocated in a macOS system malloc zone. PartitionAlloc-Everywhere (PA-E) only intercepts the default zone, meaning this allocation is likely unprotected by BackupRefPtr (BRP). An attacker controlling the renderer can spray the browser heap to control the reallocated memory, leading to RCE in the Browser process.

Suggested Fix

Ensure _trackingRectUserData is explicitly cleared alongside _trackingRectOwner.

OBJECTIVEC
// ui/base/cocoa/tool_tip_base_view.mm
- (void)removeTrackingRect:(NSTrackingRectTag)tag {
  ...
  if (tag == kTrackingRectTag) {
    _trackingRectOwner = nil;
    _trackingRectUserData = nullptr; // FIX
    return;
  }
  ...
}

- (void)_removeTrackingRects:(NSTrackingRectTag *)tags count:(int)count {
  ...
    DCHECK(tag == kTrackingRectTag);
    _trackingRectOwner = nil;
    _trackingRectUserData = nullptr; // FIX
  }
}

Additionally, add robust nil-checks for self.window and _trackingRectUserData in _sendToolTipMouseEntered and _sendToolTipMouseExited.

Evaluated with Chrome root at commit: c1eba8ce379f5d218a2948fafbb5dd72cfa30529


Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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.

Raised in root component due to access or custom field issues on 1974931

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 tooltip removal methods clear the owner pointer but fail to clear the cached user-data pointer, leaving it dangling after the underlying AppKit tooltip struct is freed.

Impact

A compromised renderer could exploit this use-after-free to achieve remote code execution in the browser process, potentially escaping the sandbox; the text notes that the allocation is likely unprotected by BackupRefPtr, making heap spraying feasible.

What the attacker needed

Compromised renderer; macOS; view detached from window; tooltip removed

The fix

The fix should explicitly clear the cached user-data pointer alongside the owner pointer in the tooltip removal methods, and add nil-checks for the window and pointer in the tooltip event methods.

How it was found

  1. A tooltip is displayed and AppKit allocates an NSToolTip struct, with Chromium caching a pointer to it.
  2. The view is detached from its window, making self.window nil.
  3. The tooltip is removed, freeing the NSToolTip memory but leaving the cached pointer dangling.
  4. A compromised renderer sends a tooltip update IPC message with a non-empty string.
  5. The browser calls setToolTipAtMousePoint:, which removes all tooltips and then attempts to add a new one; because the window is nil, tracking rect creation is deferred and the dangling pointer remains.
  6. The code then calls _sendToolTipMouseEntered or _sendToolTipMouseExited, which construct a fake NSEvent using the dangling pointer and dispatch it to NSToolTipManager, causing a use-after-free.

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 is when a program keeps a reference to memory it has already freed, and later uses that stale reference. Here, a macOS tooltip object is freed but a pointer to it is not cleared, so a malicious web page (through the renderer) can make the browser use the freed memory. This could let an attacker run their own code in the browser process, which is more powerful than the sandboxed renderer.

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.