Use after free Autofill (CVE-2026-12020)
A use-after-free vulnerability exists in the browser process on macOS within AutofillProgressDialogControllerImpl::OnDismissed. An attacker could potentially control execution flow if they can groom the heap during the nested event loop.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 16 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 on macOS within AutofillProgressDialogControllerImpl::OnDismissed. During non-interactive autofill unmasking on devices without biometrics, executing a device authentication callback spins a nested CFRunLoop to display the system password prompt. If the tab is closed during this nested loop, the controller is destroyed, causing a UAF when the prompt is closed and execution resumes.
Affected files:
components/autofill/core/browser/ui/payments/autofill_progress_dialog_controller_impl.cc
Estimated timestamp from git blame: 2023-05-10
Root Cause Analysis
A potential Use-After-Free (UAF) vulnerability exists in the browser process on macOS due to unsafe member access after a nested event loop executes in AutofillProgressDialogControllerImpl::OnDismissed located in components/autofill/core/browser/ui/payments/autofill_progress_dialog_controller_impl.cc.
void AutofillProgressDialogControllerImpl::OnDismissed(
bool is_canceled_by_user) {
// 1. View is reset here
autofill_progress_dialog_view_.reset();
if (is_canceled_by_user) {
std::move(cancel_callback_).Run();
} else {
if (no_interactive_authentication_callback_) {
// 2. Callback runs and blocks synchronously inside nested loop
std::move(no_interactive_authentication_callback_).Run();
}
}
// 4. Execution resumes here after destruction, leading to UAF
AutofillMetrics::LogProgressDialogResultMetric(
is_canceled_by_user, autofill_progress_dialog_type_);
cancel_callback_.Reset();
}
When a user authenticates on a macOS device without biometrics configured (e.g., Touch ID disabled), the device authenticator falls back to screen-lock passcode verification. This triggers AuthenticatorMac::AuthenticateUserWithNonBiometrics which calls password_manager_util_mac::AuthenticateUser. This function calls the blocking macOS API base::mac::GetAuthorizationRightsWithPrompt to prompt the user for their system login credentials.
While this system-modal dialog is active, a nested CFRunLoop is spun on the UI thread to keep the browser UI responsive. If the web page initiates a tab or popup closure (e.g., via window.close()) during this nested event loop, the corresponding WebContents is destroyed. This triggers the destruction of ChromeAutofillClient, its member ChromePaymentsAutofillClient, and finally the AutofillProgressDialogControllerImpl instance itself.
Bypassing the Safety Guard
Normally, the controller's destructor has a safety mechanism to prevent UAF if the tab is closed:
AutofillProgressDialogControllerImpl::~AutofillProgressDialogControllerImpl() {
if (autofill_progress_dialog_view_) {
autofill_progress_dialog_view_->InvalidateControllerForCallbacks();
OnDismissed(/*is_canceled_by_user=*/true);
autofill_progress_dialog_view_ = nullptr;
}
}
However, in the described scenario, OnDismissed was already invoked by the view manager. Crucially, the very first statement of OnDismissed is autofill_progress_dialog_view_.reset(). Since autofill_progress_dialog_view_ is already nullptr when the destructor executes during the nested run loop, this safety conditional block is entirely bypassed, and this is safely deallocated while the execution frame remains on the stack.
Once the user cancels or completes the macOS prompt, the nested run loop exits and execution resumes in OnDismissed directly after the callback. Accessing autofill_progress_dialog_type_ and resetting cancel_callback_ (which is a base::OnceClosure holding a reference-counted BindStateBase) on a deallocated this pointer results in a Use-After-Free. This allows an attacker to control execution flow if they can successfully groom the heap during the nested event loop.
Potential Trigger Path
Note: These are potential steps reconstructed through static analysis. Our tooling does not currently have the capability to execute live code or verify this dynamically with a proof-of-concept.
- A user visits a page with a credit card form on a macOS device without biometrics configured (mandatory reauth enabled).
- The user selects a card from Autofill, triggering a progress dialog.
- The Payments server returns a successful response without requiring interactive challenges (
kNoAuthenticationRequired). CreditCardAccessManagertriggersCloseAutofillProgressDialog, bindingStartDeviceAuthenticationForFillingtono_interactive_authentication_callback_.- The progress dialog is closed synchronously, and
OnDismissed(false)is invoked. no_interactive_authentication_callback_runs, invoking the system-modal passcode prompt which spins a nestedCFRunLoop.- While the OS dialog is active, the opener page closes the popup. This destroys the
WebContentsand frees theAutofillProgressDialogControllerImpl. - Once the user closes the OS dialog, the nested loop exits, and
OnDismissedresumes and accesses member fields on the freedthisobject.
Suggested Remediation
To remediate this issue, use a base::WeakPtr of this to check if the controller is still alive before executing any further member access or callback resets after the synchronous callback is run:
void AutofillProgressDialogControllerImpl::OnDismissed(
bool is_canceled_by_user) {
autofill_progress_dialog_view_.reset();
if (is_canceled_by_user) {
std::move(cancel_callback_).Run();
} else {
if (no_interactive_authentication_callback_) {
base::WeakPtr<AutofillProgressDialogControllerImpl> weak_this =
weak_ptr_factory_.GetWeakPtr();
std::move(no_interactive_authentication_callback_).Run();
if (!weak_this) {
return;
}
}
}
AutofillMetrics::LogProgressDialogResultMetric(
is_canceled_by_user, autofill_progress_dialog_type_);
cancel_callback_.Reset();
}
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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
The code accesses member variables after a callback that runs a nested event loop, during which the object can be destroyed, and the destructor's safety check is bypassed because the view pointer was already reset.
Impact
This allows an attacker to control execution flow if they can successfully groom the heap during the nested event loop.
What the attacker needed
MacOS device without biometrics; mandatory reauth enabled; user selects a card from Autofill; opener page closes popup during prompt
The fix
The issue should be fixed by using a base::WeakPtr of this to check if the controller is still alive before executing any further member access or callback resets after the synchronous callback is run.
How it was found
- A user visits a page with a credit card form on a macOS device without biometrics configured (mandatory reauth enabled).
- The user selects a card from Autofill, triggering a progress dialog.
- The Payments server returns a successful response without requiring interactive challenges (kNoAuthenticationRequired).
- CreditCardAccessManager triggers CloseAutofillProgressDialog, binding StartDeviceAuthenticationForFilling to no_interactive_authentication_callback_.
- The progress dialog is closed synchronously, and OnDismissed(false) is invoked.
- no_interactive_authentication_callback_ runs, invoking the system-modal passcode prompt which spins a nested CFRunLoop.
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 is a type of bug where a program tries to use memory that has already been freed. In this case, a dialog for autofill on macOS can be closed while a system password prompt is showing, causing the program to later access memory that no longer belongs to it. This could let an attacker take control of the browser if they can arrange memory carefully.
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.