Use after free in Chrome for iOS (CVE-2026-10885)
A use-after-free exists in Chrome for iOS's web_view component where a back-forward list object keeps a raw pointer to a destroyed navigation manager after the web view is deallocated without calling shutDown. An attacker could potentially trigger remote code execution by causing the embedder to retain the list and then accessing it after the web view is freed.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 46 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 without the Chrome Security team. Please see go/chrome-ai-generated-security-bugs-faq for more information.
Overview: A Use-After-Free vulnerability exists in ios/web_view where CWVBackForwardList retains a dangling raw C++ pointer to a destroyed web::NavigationManager. This occurs when an embedding application releases a CWVWebView without calling the internal shutDown method, leaving the pointer un-nulled during standard deallocation. Accessing the list thereafter results in virtual calls on freed memory, potentially leading to Remote Code Execution.
Affected files:
ios/web_view/internal/cwv_web_view.mmios/web_view/internal/cwv_back_forward_list.mmios/web_view/internal/cwv_back_forward_list_internal.h
Estimated timestamp from git blame: 2018-10-24
Background
In ChromeWebView.framework (ios/web_view), the CWVBackForwardList Objective-C object provides the host application with access to the navigation history of a CWVWebView. Internally, it relies on a raw C++ pointer to fetch data, declared in ios/web_view/internal/cwv_back_forward_list_internal.h:
@property(nonatomic, nullable) const web::NavigationManager* navigationManager;
Vulnerability Details
The web::NavigationManager memory is owned by the web::WebState instance managed by the parent CWVWebView. A Use-After-Free condition arises because the standard deallocation path of CWVWebView does not clear the navigationManager pointer stored in its associated CWVBackForwardList.
While the internal -[CWVWebView shutDown] method correctly nullifies this pointer (_backForwardList.navigationManager = nil;), standard ARC deallocation via -[CWVWebView dealloc] does not. It is a documented expectation that dealloc can be called without shutDown occurring first (see comments in ios/web_view/internal/autofill/web_view_autofill_client_ios.h).
When a CWVWebView is deallocated, its std::unique_ptr<web::WebState> is destroyed, which in turn destroys the NavigationManagerImpl. If the embedding iOS application has retained a strong reference to the CWVBackForwardList object to power its history UI, the navigationManager property becomes a dangling pointer to freed memory.
Subsequent access to the list (e.g., -[CWVBackForwardList currentItem]) bypasses the nil check because the pointer is dangling, and executes a virtual C++ call: self.navigationManager->GetLastCommittedItem().
Potential Exploitation Steps
Note: These are theoretical steps based on code analysis; our tooling agent does not run exploit code.
- Setup: An attacker hosts a malicious page and the victim visits it via an app using
ChromeWebView.framework. - Popup Creation: The attacker's script calls
window.open(), prompting the embedder to create a newCWVWebViewinstance. - UI Retention: The embedder application requests
webView.backForwardListand retains it for its custom navigation UI. - Trigger Closure: The attacker's script calls
window.close()on the popup. This triggers-[CWVUIDelegate webViewDidClose:]. - Deallocation: The embedder handles the delegate call by removing the popup from the view hierarchy and dropping its strong reference. The
CWVWebViewdeallocates, destroying theNavigationManagerwhile leaving the dangling pointer in the retainedCWVBackForwardList. - Heap Spray: The attacker's surviving opener page runs a JavaScript loop to allocate large objects, reclaiming the freed memory slot previously held by the
NavigationManagerImpl. (Note:ios/web_viewapp extensions are built withuse_partition_alloc = false, meaning BackupRefPtr mitigation is not active). - Execution: The embedder app updates its UI and accesses the
currentItemof the retained back-forward list. The virtual call uses the attacker-controlled vtable, leading to Remote Code Execution (RCE) in the browser process.
Suggested Fix
The -[CWVWebView dealloc] method should be updated to explicitly nullify the navigationManager pointer on the _backForwardList, mirroring the logic found in the shutDown method.
// In ios/web_view/internal/cwv_web_view.mm
- (void)dealloc {
_backForwardList.navigationManager = nil;
if (_webState) {
if (_webStateObserver) {
_webState->RemoveObserver(_webStateObserver.get());
_webStateObserver.reset();
}
WebViewHolder::RemoveFromWebState(_webState.get());
}
}
Evaluated with Chrome root at commit: 7353d249d9cacf9c7218e1d7b8a39cf39c72d646
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.
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 dealloc method of CWVWebView does not nullify the navigationManager pointer in its associated CWVBackForwardList, unlike the shutDown method, leaving a dangling pointer after the WebState is destroyed.
Impact
A use-after-free could lead to remote code execution in the browser process, though the report notes these are theoretical steps and no exploit was run.
What the attacker needed
Victim uses an app embedding ChromeWebView; victim visits attacker page; embedder retains backForwardList
The fix
The dealloc method should be updated to explicitly nullify the navigationManager pointer, mirroring the logic in shutDown.
How it was found
- Victim visits a malicious page in an app using ChromeWebView.framework.
- The page calls window.open() to create a new CWVWebView.
- The embedder retains the webView.backForwardList for its UI.
- The page calls window.close() on the popup, triggering webViewDidClose:.
- The embedder drops its reference, deallocating the CWVWebView and destroying the NavigationManager while the back-forward list still holds a dangling pointer.
- The attacker's opener page runs a JavaScript loop to reclaim the freed memory, then the embedder accesses currentItem, leading to a virtual call on attacker-controlled memory.
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 web view is closed, some internal memory is freed, but a list object that the app might still hold keeps a pointer to that freed memory. If the app later tries to use the list, it reads from memory that no longer belongs to it, which can crash the app or 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.