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

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

The report claims a heap use-after-free in Chromium's focus manager, where raw stack pointers to a focused view are cached and then used after a focus change callback synchronously destroys that view. An attacker could, in theory, reclaim the freed memory and redirect a virtual call to achieve code execution in the browser process, though no proof of concept was built.

Google Chrome

Originally disclosed on Chrome VRP

Critical View original
  • Fix shipped in 24 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 heap-use-after-free vulnerability exists in FocusManager::StoreFocusedView and ClearFocus because raw View* pointers are cached on the stack. Operations like SetFocusedView(nullptr) can synchronously destroy the view via focus change callbacks, leaving the stack pointers dangling and bypassing MiraclePtr protections.

Affected files:

  • ui/views/focus/focus_manager.cc

Estimated timestamp from git blame: Unknown (Google3 checkout)

Summary

A potential heap-use-after-free (UAF) vulnerability has been identified in FocusManager::StoreFocusedView and FocusManager::ClearFocus within ui/views/focus/focus_manager.cc. These functions cache raw pointers to View objects on the stack and subsequently perform operations that can trigger the synchronous destruction of those views via focus change callbacks. Because the pointers are raw stack variables, they bypass MiraclePtr (BackupRefPtr) protections, leading to a UAF that could be leveraged for arbitrary code execution in the browser process.

Vulnerability Details

In FocusManager::StoreFocusedView, raw pointers to the currently focused view are cached on the stack (focused_view and v):

C++
void FocusManager::StoreFocusedView(bool clear_native_focus) {
  View* focused_view = focused_view_;
  // ...
  View* v = focused_view_;

  if (clear_native_focus) {
    // ...
    ClearFocus();
  } else {
    SetFocusedView(nullptr);
    SetStoredFocusView(focused_view); // <--- Potential Use-After-Free
  }

  if (v) {
    v->SchedulePaint();  // <--- Potential Use-After-Free
  }
}

A similar pattern exists in FocusManager::ClearFocus.

The vulnerability occurs because the call to SetFocusedView(nullptr) (or ClearFocus, which also sets focus to null) triggers SetFocusedViewWithReason. This method explicitly calls Blur() on the previously focused view.

In the Chromium UI framework, it is a supported and documented behavior for transient UI components (e.g., text selection handles, dropdown menus, or elements utilizing ash::SystemTextfield) to synchronously destroy themselves when losing focus. The framework anticipates this; SetFocusedViewWithReason itself uses a ViewTracker specifically to handle the view being destroyed during the Blur() call (crbug.com/1221133).

However, StoreFocusedView does not use ViewTracker for its local variables. If the view destroys itself during Blur():

  1. The view is removed from the hierarchy, and all raw_ptr<View> references to it (including FocusManager::focused_view_) are cleared.
  2. Because all raw_ptr references are removed, the MiraclePtr (BackupRefPtr) reference count drops to exactly zero.
  3. PartitionAlloc genuinely frees the memory, returning it to the thread cache.
  4. Execution returns to StoreFocusedView, where the raw stack pointers focused_view and v remain dangling.

Subsequently, SetStoredFocusView(focused_view) passes the dangling pointer to ViewTracker::SetView, which attempts to register an observer on the freed object. Additionally, v->SchedulePaint() calls a virtual method (GetWidget()) on the freed object.

Suggested Attacker Steps

(Note: These are potential steps based on code analysis; a working proof of concept has not been developed.)

  1. Setup: An attacker controls web content that triggers the display of a transient, focusable browser UI element (e.g., a specific prompt, bubble, or textfield).
  2. Trigger Focus Change: The attacker uses Javascript (e.g., window.blur()) or user interaction to forcefully deactivate the browser window. This triggers DesktopNativeWidgetAura::HandleActivationChanged(), which calls GetWidget()->GetFocusManager()->StoreFocusedView(false);.
  3. Synchronous Destruction: As focus is cleared, the transient UI element receives the Blur() signal and synchronously destroys itself and its widget.
  4. Heap Spray: The attacker utilizes web-accessible heap spraying techniques to reclaim the freed View memory chunk before the vulnerable functions resume.
  5. Execution: When StoreFocusedView resumes, it executes v->SchedulePaint(), invoking a virtual method on the reclaimed memory. By placing a fake vtable in the sprayed memory, the attacker can redirect execution to an arbitrary address, achieving an S0 sandbox escape.

Proposed Fix

Update StoreFocusedView and ClearFocus to use ViewTracker to track views instead of using raw stack pointers. This ensures that the local variables safely become null if the view is destroyed during synchronous callbacks, preventing the UAF.

Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb


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 focus manager stores raw pointers to a view in local variables and then calls code that can synchronously destroy that view, so the locals dangle and bypass the project's pointer protections.

Impact

The report claims this could be leveraged for arbitrary code execution in the browser process and an S0 sandbox escape, but it notes that no working proof of concept has been developed.

What the attacker needed

Attacker-controlled web content; victim's window loses focus; no PoC demonstrated

The fix

The focus manager should track the view with a ViewTracker instead of raw stack pointers so the locals become null if the view is destroyed during the callback.

How it was found

  1. Get web content to display a transient, focusable browser UI element.
  2. Force the browser window to lose focus, for example from JavaScript or by user interaction.
  3. The element receives the blur signal and destroys itself and its widget synchronously.
  4. Spray the heap from web content to reclaim the freed memory.
  5. When the focus code resumes it calls a virtual method on the reclaimed memory, which the attacker has shaped.

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 browser window loses focus, the code that handles this keeps a note of which on-screen element was focused. Some elements delete themselves the moment they lose focus, so that note now points at memory that has been freed. If an attacker can put their own data in that freed memory, the browser might follow it and run the attacker's instructions.

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.