Use after free in Autofill (CVE-2026-10934)
A use-after-free exists in the Android Authenticator Selection Dialog because the C++ view object deletes itself on dismissal while the Java UI remains clickable during a 200ms fade-out animation. An attacker could trigger a native callback on the freed object, potentially leading to arbitrary code execution in the browser process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 53 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.
Overview: A potential Use-After-Free (UAF) exists in the browser process when dismissing the Android Authenticator Selection Dialog. The C++ view object deletes itself upon dismissal, but the Java-side UI remains clickable during a 200ms fade-out animation, allowing an attacker to trigger a native callback on the freed object.
Affected files:
chrome/browser/ui/android/autofill/authenticator_selection_dialog_view_android.ccchrome/browser/ui/android/autofill/internal/java/src/org/chromium/chrome/browser/ui/autofill/AuthenticatorSelectionDialogBridge.javachrome/browser/ui/android/autofill/internal/java/src/org/chromium/chrome/browser/ui/autofill/AuthenticatorSelectionDialog.java
Estimated timestamp from git blame: 2023-01-06
Summary
A potential Use-After-Free (UAF) vulnerability exists in the browser process due to a lifecycle mismatch between the C++ AuthenticatorSelectionDialogViewAndroid and its Java-side UI counterpart during dialog dismissal. This may allow a compromised renderer to achieve arbitrary code execution in the browser process (Sandbox Escape).
Technical Details
The vulnerability occurs during the dismissal sequence of the Authenticator Selection tab-modal dialog:
- Setup: When created,
AuthenticatorSelectionDialogViewAndroidpassesreinterpret_cast<intptr_t>(this)toAuthenticatorSelectionDialogBridge.java, where it is stored as ajlong(mNativeCardUnmaskAuthenticationSelectionDialogView). - Dismissal: If a background navigation occurs,
TabModalLifetimeHandlerclears active dialogs.ModalDialogManager.dismissDialog()immediately triggers the controller'sonDismisscallback. - The Free: This callback routes to the JNI method
AuthenticatorSelectionDialogViewAndroid::OnDismissed(), which executesdelete this;. The C++ object is now freed. - The Window: Immediately following the
onDismisscallback,TabModalPresenterbegins a 200ms fade-out animation. During this time, theModalDialogViewremains attached to the Android view hierarchy and its click listeners remain active. - The Use: If a user clicks a button during this 200ms window, the click event routes to
AuthenticatorSelectionDialogBridge.onOptionSelected(). The Java bridge uses its danglingjlongpointer to invoke the nativeOnOptionSelected()method on the freed C++ object. - Exploitation: Inside the freed object, a virtual call is made:
controller_->SetSelectedChallengeOptionId(...). Because the dangling reference is ajlong, MiraclePtr does not protect it. If an attacker sprays the browser heap and reallocates the freed memory, they can overwrite thecontroller_field. When theraw_ptr<controller_>is dereferenced, it fetches the attacker's fake pointer and executes an indirect call through a fake vtable, hijacking control flow.
Potential Reproduction Steps
Note: These are suggested steps; our tooling agent does not yet have the ability to run code to verify an active exploit.
- The user browses to an attacker-controlled page that triggers an autofill prompt for a card requiring authentication (e.g., CVC/OTP).
- The user taps the card to display the Authenticator Selection tab-modal dialog.
- The attacker's page executes a Javascript navigation (e.g.,
location.href = '...';) precisely timed to occur just as the user taps the "Continue" button. - The navigation triggers the dialog's dismissal (freeing the C++ object) milliseconds before the tap event is processed by the Android UI thread.
- The tap event fires during the 200ms exit animation, invoking the JNI callback on the freed C++ object.
Suggested Fix
The Java AuthenticatorSelectionDialogBridge must invalidate its native pointer upon dismissal.
- In
AuthenticatorSelectionDialogBridge.java, remove thefinalmodifier frommNativeCardUnmaskAuthenticationSelectionDialogView. - Inside
AuthenticatorSelectionDialogBridge.onDialogDismissed(), setmNativeCardUnmaskAuthenticationSelectionDialogView = 0;after making the JNI call. - Add a check
if (mNativeCardUnmaskAuthenticationSelectionDialogView == 0) return;at the beginning ofonOptionSelected()and any other methods that call back into JNI.
Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b
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 a lifecycle mismatch: the Java bridge holds a raw pointer to the C++ object and does not invalidate it when the C++ object is deleted during dismissal, while the Java UI remains interactive during the fade-out animation.
Impact
A compromised renderer could potentially achieve arbitrary code execution in the browser process, escaping the sandbox.
What the attacker needed
Android device; attacker-controlled web page; user interaction (tap); compromised renderer
The fix
The Java bridge should invalidate its native pointer upon dismissal and check for a null pointer before calling back into native code.
How it was found
- The user browses to an attacker-controlled page that triggers an autofill prompt for a card requiring authentication.
- The user taps the card to display the Authenticator Selection tab-modal dialog.
- The attacker's page executes a JavaScript navigation precisely timed to occur just as the user taps the 'Continue' button.
- The navigation triggers the dialog's dismissal, freeing the C++ object milliseconds before the tap event is processed.
- The tap event fires during the 200ms exit animation, invoking the JNI callback on the freed C++ object.
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 frees memory but still keeps a pointer to it, and later uses that pointer as if the memory were still valid. Here, the dialog's C++ object is deleted when the dialog is dismissed, but the Java part of the dialog can still be clicked for a short time, so a click can call back into the freed object. This could let an attacker who controls a web page take over the browser process.
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.