Use after free in iOS (CVE-2026-9956)
A use-after-free vulnerability exists in Chrome for iOS where the credential suggestion bottom sheet stores raw pointers to PasswordForm objects that are freed during cross-document navigation. If the user interacts with the persistent bottom sheet after navigation, the dangling pointers are dereferenced, leading to a use-after-free and potential arbitrary memory read.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 39 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 potential Use-After-Free exists in the iOS browser process within CredentialSuggestionBottomSheetMediator. The mediator stores raw pointers to PasswordForm objects that are freed during cross-document navigation, and subsequently dereferences them if the user interacts with the persistent bottom sheet.
Affected files:
ios/chrome/browser/passwords/bottom_sheet/coordinator/credential_suggestion_bottom_sheet_mediator.mmcomponents/password_manager/ios/shared_password_controller.mmios/chrome/browser/autofill/model/bottom_sheet/autofill_bottom_sheet_tab_helper.mmios/chrome/browser/passwords/bottom_sheet/coordinator/credential_suggestion_bottom_sheet_mediator_base.mmios/chrome/browser/browser_view/ui_bundled/browser_coordinator.mm
Estimated timestamp from git blame: 2024-02-29
Summary
A potential use-after-free (UAF) vulnerability exists in the browser process of Chrome for iOS. The CredentialSuggestionBottomSheetMediator incorrectly maintains raw pointers to PasswordForm objects. These objects are destroyed during same-tab cross-document navigations, but the bottom sheet UI is not automatically dismissed. If a user interacts with the bottom sheet after a navigation has occurred, the application dereferences these dangling pointers, leading to a UAF and a potential arbitrary memory read.
Technical Details
When the password bottom sheet is triggered on iOS for a page containing credentials received via Google Password Sharing (where sharing_notification_displayed is false), CredentialSuggestionBottomSheetMediator::fetchCredentialsForForm:webState: is called.
This method retrieves suggestions from PasswordManager::GetBestMatches, which returns a base::span<const password_manager::PasswordForm> pointing to the internal std::vector<PasswordForm> best_matches_ inside FormFetcherImpl. The mediator then stores raw pointers to the shared credentials in its std::vector<const password_manager::PasswordForm*> _sharedUnnotifiedForms member variable.
When a cross-document navigation occurs in the same tab, SharedPasswordController::webState:didFinishNavigation: detects the navigation and calls PasswordManager::DidNavigateMainFrame. This resets the password cache (password_form_cache_.Clear()), which destroys all PasswordFormManager and FormFetcherImpl objects associated with the previous page. The best_matches_ vector is destructed, freeing the memory.
The vulnerability exists because the credential bottom sheet is not dismissed upon same-tab navigation. The mediator only dismisses the sheet on tab switches (via WebStateListObserving).
When the victim subsequently interacts with the persistent sheet (e.g., swiping it away or selecting 'Use Keyboard'), the mediator calls -markSharedPasswordNotificationsDisplayed. This method iterates through _sharedUnnotifiedForms and performs a copy-construction:
password_manager::PasswordForm updatedForm = *form;
Since form is a dangling pointer, this results in a UAF read. The PasswordForm struct contains numerous complex members like std::u16string and std::string. The copy constructor will attempt to read string sizes and pointers from the freed memory, leading to an arbitrary memory read primitive. The corrupted object is then passed to PasswordStoreInterface::UpdateLogin.
Note: MiraclePtr (BackupRefPtr) does not protect against this issue because the dangling pointers are bare const T* elements within a std::vector, not raw_ptr<>.
Potential Reproduction Steps
Please note: These are theoretical steps as we do not have a working Proof of Concept.
- An attacker (who must be a member of the victim's Google Family Group) shares a password for
https://attacker.examplewith the victim. - The victim opens
https://attacker.examplein iOS Chrome. The page contains a login form and a script designed to trigger navigation after a short delay (e.g.,setTimeout(() => location.href = '/next', 2000)). - The victim taps a password field, triggering the password bottom sheet. The mediator populates
_sharedUnnotifiedFormswith raw pointers to the shared credential. - The page's timer fires and a cross-document navigation commits. This destroys the
PasswordFormManagerand frees thePasswordFormobjects in memory. The bottom sheet remains visible on screen. - The victim interacts with the bottom sheet (e.g., dismisses it by swiping down).
- The mediator attempts to mark the notification as displayed, dereferencing the dangling pointer in the browser process.
Suggested Fix
To fix this issue, _sharedUnnotifiedForms should not store raw pointers to memory owned by the Password Manager cache. Instead, it should store independent copies of the PasswordForm objects, or store a unique identifier (like the form's primary key) that can be used to safely look up or update the form in the Password Store later. Additionally, it is highly recommended to update the coordinator or mediator to dismiss the bottom sheet when a same-tab cross-document navigation occurs, by implementing web::WebStateObserver.
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
The mediator stores raw pointers to PasswordForm objects owned by the password manager cache, which are destroyed on navigation, and the bottom sheet is not dismissed on same-tab navigation.
Impact
A use-after-free could lead to an arbitrary memory read, potentially disclosing sensitive information or causing a crash.
What the attacker needed
Attacker in victim's Google Family Group; victim uses Chrome on iOS; victim visits attacker's site; victim taps password field
The fix
The fix should store independent copies of PasswordForm objects or unique identifiers instead of raw pointers, and dismiss the bottom sheet on same-tab navigation.
How it was found
- An attacker shares a password for a site with the victim.
- The victim opens the site, which has a script to navigate after a delay.
- The victim taps a password field, triggering the bottom sheet and storing raw pointers.
- The page navigates, freeing the PasswordForm objects, but the bottom sheet remains.
- The victim interacts with the bottom sheet, causing dereference of dangling pointers.
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 keeps a reference to memory after it has been freed, then tries to use it again. Here, the password suggestion pop-up in Chrome on iOS remembers where password data was stored, but that data is deleted when you navigate to a new page. If you then interact with the pop-up, the program reads from the freed memory, which could leak information or crash.
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.