Use after free in Browser (CVE-2026-13782)
A static-analysis report claims a use-after-free in the browser process: while ExclusiveAccessManager iterates its controllers on tab-lifecycle events, a synchronous fullscreen transition can destroy the parent widget and delete the manager and its controllers, leaving the loop and stack frames pointing at freed memory. The author says a compromised renderer could theoretically trigger this, but no proof of concept was executed.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 36 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 the browser process when ExclusiveAccessManager delegates tab lifetime events to its controllers. During synchronous fullscreen state transitions or nested event processing, the parent browser widget can be destroyed, causing the premature deletion of the ExclusiveAccessManager and its controllers. Unwinding the stack or continuing the iteration loop then accesses the freed memory, leading to potential browser process memory corruption.
Affected files:
chrome/browser/ui/exclusive_access/exclusive_access_manager.ccchrome/browser/ui/exclusive_access/fullscreen_controller.ccchrome/browser/ui/exclusive_access/exclusive_access_controller_base.ccchrome/browser/ui/exclusive_access/exclusive_access_manager.h
Estimated timestamp from git blame: 2024-03-04
Root Cause & Potential Vulnerability Mechanism
ExclusiveAccessManager distributes tab-lifecycle events (such as OnTabClosing, OnTabDeactivated, etc.) by iterating over exclusive_access_controllers_ (chrome/browser/ui/exclusive_access/exclusive_access_manager.cc):
void ExclusiveAccessManager::OnTabClosing(WebContents* web_contents) {
for (auto controller : exclusive_access_controllers_) {
controller->OnTabClosing(web_contents);
}
}
exclusive_access_controllers_ is a base::flat_set<raw_ptr<ExclusiveAccessControllerBase>> containing pointers to the manager's own sub-object members:
fullscreen_controller_keyboard_lock_controller_pointer_lock_controller_
Due to the sorted order of base::flat_set and the declaration order of the sub-objects, fullscreen_controller_ is processed first.
During FullscreenController::OnTabClosing(), the execution flows to ExitExclusiveAccessIfNecessary(), which can transition window states or call exclusive_access_manager()->context()->ExitFullscreen(). On certain platforms (specifically macOS or Windows), transitioning fullscreen states or native window configurations can spin a nested run loop or synchronously dispatch native window messages (e.g., WM_CLOSE).
If the parent widget is synchronously destroyed during this dispatch, its destructor (BrowserWidget::~BrowserWidget()) triggers pre-destruction teardown:
browser_view_->browser()->GetFeatures().TearDownPreBrowserWindowDestruction();
This invokes exclusive_access_manager_.reset(), deleting the ExclusiveAccessManager instance and all its controller sub-objects on the heap. However, the stack frames executing within FullscreenController and the range-based for loop in ExclusiveAccessManager are not guarded against this destruction. This leads to several potential cascading UAF conditions:
- UAF in Range-for Iteration: The loop iterators (
__begin,__end) point directly into the deletedbase::flat_set's backing heap memory, resulting in an immediate UAF read or write upon the next iteration. - UAF in
FullscreenControllerTail: Upon returning from the nested native dispatch, remaining lines inExitFullscreenModeInternal()(such asextension_url_.reset()orexclusive_access_manager()->UpdateBubble(...)) execute on a freedthispointer. - UAF in
AutoResetDestructor: InFullscreenController::OnTabDeactivated(), stack unwinding triggers the destructor ofbase::AutoReset<raw_ptr<content::WebContents>>, writing to the deallocated controller instance. - Base Class Notification Hazard: In
ExclusiveAccessControllerBase::OnTabClosing(), the call toNotifyTabExclusiveAccessLost()runs after the object may have already been synchronously destroyed.
Note: Our tooling does not currently have the capability to execute code or run functional proof-of-concept tests locally, so these are potential steps and flows based on static source code analysis.
Suggested Potential Replication Flow
An attacker operating from a compromised renderer could theoretically attempt the following steps:
- Open a script-closable browser window and request tab-fullscreen using
LocalFrameHost::EnterFullscreen. - Register a task to close the parent window/widget synchronously during native window message handling (e.g., handling macOS AppKit event loops or queuing a
WM_CLOSEto be processed during state transitions on Windows). - Programmatically close the tab, invoking the
OnTabClosingevent pipeline. - As the loop processes the first element (
FullscreenController), the synchronous transition forces the destruction of the parent widget and resetsExclusiveAccessManager. - Upon stack unwinding, invalid read/write instructions execute on the freed controller members, or the loop attempts to dereference the invalidated set iterator.
Suggested Fix
To prevent destruction of the manager from invalidating active stack contexts, use a base::WeakPtr to guard the iteration and controller processing, and replace the range-based for loop with index-based iteration. For example:
void ExclusiveAccessManager::OnTabClosing(WebContents* web_contents) {
base::WeakPtr<ExclusiveAccessManager> weak_this = weak_ptr_factory_.GetWeakPtr();
for (size_t i = 0; i < exclusive_access_controllers_.size(); ++i) {
auto* controller = exclusive_access_controllers_[i];
controller->OnTabClosing(web_contents);
if (!weak_this) {
return;
}
}
}
Evaluated with Chrome root at commit: a2bea94528f4bd6cc57739c43fa3bb890b8367d3
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.
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 controller callbacks can synchronously destroy the owning widget and manager, and neither the iteration over the controller set nor the remaining stack frames are guarded against that destruction.
Impact
Could lead to browser process memory corruption, potentially exploitable from a compromised renderer, though the report is based only on static analysis and no exploit was demonstrated.
What the attacker needed
Compromised renderer; script-closable window; fullscreen state transition
The fix
The report suggests guarding the iteration with a weak pointer and using index-based iteration so processing stops once the manager is destroyed.
How it was found
- Open a script-closable window and request tab-fullscreen.
- Arrange for the parent window to be closed synchronously during native window message handling.
- Close the tab so the tab-closing event pipeline runs.
- The first controller's fullscreen transition destroys the parent widget and resets the manager.
- On unwinding, the freed controller members or the invalidated set iterator are accessed.
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 tab closes or loses focus, the browser tells several helper objects about it, one after another. The report argues that one of those helpers can, as a side effect, cause the whole group of helpers to be deleted while the browser is still part-way through the list, so it then reads memory that no longer belongs to it. That kind of mistake is called a use-after-free and can crash the browser or, in the worst case, 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.