Skip to content
Memory corruption Advisory Advanced CVE-2026-87526

Use after free in Passwords (CVE-2026-87526)

A password-change success bubble forwarded a callback holding raw pointers to its label and toggle button into an asynchronous OS reauthentication prompt without wrapping it in a weak pointer. If the bubble was closed without navigating while the prompt was pending, the freed views were later dereferenced, giving a heap use-after-free in the browser process.

shab Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 30 days

Summary

The "Password changed successfully" bubble's eye icon binds raw views::Label* and views::ToggleImageButton* into a callback that is forwarded, without a WeakPtr wrap, to ManagePasswordsUIController and stored inside a DeviceAuthenticator while the OS reauth prompt (Windows Hello / Touch ID) runs asynchronously.

If the bubble closes while the prompt is pending — via a path that does not navigate — the view subtree is freed but the authenticator is not reset. When the user then dismisses the prompt, the stored callback runs and dereferences freed heap in the browser process.

SuccessfulPasswordChangeBubbleController::AuthenticateUser is the only password bubble controller that does not wrap this callback through its own WeakPtrFactory.

Affected code

chrome/browser/ui/passwords/bubble_controllers/password_change/successful_password_change_bubble_controller.cc — AuthenticateUser:

C++
void SuccessfulPasswordChangeBubbleController::AuthenticateUser(
    base::OnceCallback<void(bool)> auth_callback) {
  ...
  if (delegate_) {
    delegate_->AuthenticateUserWithMessage(message, std::move(auth_callback));
    //                                              ^^^^^^^^^^^^^^^^^^^^^^^^
    //                            forwarded verbatim — no weak_ptr_factory_ wrap
  }
}

chrome/browser/ui/views/passwords/password_change/successful_password_change_view.cc — the callback being forwarded (sink):

C++
base::RepeatingCallback<void(bool)> auth_result_callback =
    base::BindRepeating(
        [](views::ToggleImageButton* toggle_button,
           views::Label* password_label, bool auth_result) {
          if (!auth_result) {
            return;
          }
          password_label->SetObscured(!password_label->GetObscured());  // UAF
          toggle_button->SetToggled(!toggle_button->GetToggled());      // UAF
        },
        eye_icon, password_label);

Root cause

ManagePasswordsUIController is a WebContentsUserData and outlives the bubble. AuthenticateUserWithMessage parks the callback inside biometric_authenticator_:

C++
// chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
biometric_authenticator_ = passwords_data_.client()->GetDeviceAuthenticator();
biometric_authenticator_->AuthenticateWithMessage(
    message, std::move(callback).Then(std::move(on_reauth_completed)));

The .Then() WeakPtr guards only the trailing OnReauthCompleted closure, not the caller's callback.

CancelAnyOngoingBiometricAuth() — which would drop the callback by resetting the authenticator — is called from PrimaryPageChanged() but not from OnBubbleHidden(). So bubble-close paths that don't navigate leave the dangling callback live:

  • LocationBarBubbleDelegateView::OnVisibilityChanged(HIDDEN) (tab switch, or web content opening a foreground tab)
  • LocationBarBubbleDelegateView::OnFullscreenStateChanged() (F11)

On Windows, DeviceAuthenticatorWin::Cancel() is NOTIMPLEMENTED(), so the callback is only dropped when the authenticator object itself is destroyed.

Every sibling controller wraps the callback first:

Controller Wrap site
ManagePasswordsBubbleController manage_passwords_bubble_controller.cc — BindOnce(&Self::OnUserAuthenticationCompleted, weak_ptr_factory_.GetWeakPtr(), ...)
SaveUpdateBubbleController save_update_bubble_controller.cc — same pattern
ItemsBubbleController items_bubble_controller.cc — same pattern
CredentialManagerDialogControllerImpl credential_manager_dialog_controller_impl.cc — same pattern
SuccessfulPasswordChangeBubbleController none

Data flow

click eye icon
 -> auth_result_callback bound with raw views::Label* / views::ToggleImageButton*
 -> SuccessfulPasswordChangeBubbleController::AuthenticateUser(cb)   [NO WeakPtr]
 -> ManagePasswordsUIController::AuthenticateUserWithMessage(msg, cb.Then(weak))
 -> DeviceAuthenticator::AuthenticateWithMessage  -- async OS prompt --
 -> [tab switch / F11] LocationBarBubbleDelegateView::OnVisibilityChanged(HIDDEN)
      -> CloseBubble() -> ~SuccessfulPasswordChangeView -> label + button FREED
      -> ManagePasswordsUIController::OnBubbleHidden()   [does NOT reset auth]
 -> user dismisses prompt -> std::move(callback).Run(success)
 -> SINK: password_label->SetObscured(...) on freed memory

Repro

ASan build, PASSWORD_CHANGE_STATE reachable (or instantiate SuccessfulPasswordChangeView directly in a browser test via ManagePasswordsUIController::ShowChangePasswordBubble):

  1. Complete an automated password change so the "Password changed successfully" bubble appears.
  2. Click the eye icon. The OS reauth prompt appears.
  3. Without dismissing the prompt, press Ctrl+Tab to switch tabs. The bubble disappears.
  4. Return to the prompt and click Cancel (or authenticate).

Expected ASan output:

==ERROR: AddressSanitizer: heap-use-after-free on address 0x... READ of size 8
    at ... thread T0 (CrBrowserMain)
    #0 views::Label::GetObscured()
    #1 SuccessfulPasswordChangeView::...::<lambda>::operator()
    #2 DeviceAuthenticatorWin::OnAuthenticationCompleted
freed by thread T0 here:
    #0 views::View::~View()
    #1 views::Widget::CloseNow()
    #2 LocationBarBubbleDelegateView::OnVisibilityChanged

Non-triggers (already mitigated): window deactivation alone (set_close_on_deactivate(false)); same-tab navigation (PrimaryPageChanged -> CancelAnyOngoingBiometricAuth); tab close (destroys the WebContents and therefore the authenticator).

Impact

Heap UAF in the unsandboxed browser process. The first dereference is a virtual call on a freed views::Label, followed by member writes — with heap grooming, a control-flow/write primitive.

Bounded by trust principal: the initiating eye-icon click requires local user interaction, and the destruction step requires a second user action (Ctrl+Tab / F11) or web content opening a foreground tab while the prompt is up. There is no purely remote driver.

Note: bound T* args are stored as UnretainedWrapper<T, MayNotDangle> (i.e. raw_ptr internally), so MiraclePtr does apply and dangling-detector builds should CHECK here — but that is a mitigation, not a fix.

Suggested fix

Wrap the callback through the controller's WeakPtrFactory, matching every sibling. The controller is a unique_ptr member of SuccessfulPasswordChangeView, so it is destroyed before the base views::View destructor frees the children — the weak pointers are invalidated before the label and button go away.

C++
// successful_password_change_bubble_controller.cc
void SuccessfulPasswordChangeBubbleController::AuthenticateUser(
    base::OnceCallback<void(bool)> auth_callback) {
  ...
  if (delegate_) {
    // Bind OnUserAuthenticationCompleted() using a weak_ptr such that if the
    // bubble is closed (and this controller destroyed) while the reauth flow is
    // running, `auth_callback` is never invoked. It holds pointers into the
    // bubble's view hierarchy, which is destroyed together with the bubble.
    delegate_->AuthenticateUserWithMessage(
        message, base::BindOnce(&SuccessfulPasswordChangeBubbleController::
                                    OnUserAuthenticationCompleted,
                                weak_ptr_factory_.GetWeakPtr(),
                                std::move(auth_callback)));
  }
}

void SuccessfulPasswordChangeBubbleController::OnUserAuthenticationCompleted(
    base::OnceCallback<void(bool)> auth_callback,
    bool authentication_result) {
  std::move(auth_callback).Run(authentication_result);
}
C++
// successful_password_change_bubble_controller.h -- private section
  void OnUserAuthenticationCompleted(
      base::OnceCallback<void(bool)> auth_callback,
      bool authentication_result);

Considered but not proposed: calling CancelAnyOngoingBiometricAuth() from ManagePasswordsUIController::OnBubbleHidden() as defense-in-depth. AuthenticateUserWithMessage is also driven by PasswordCredentialUIController (WebAuthn) and CredentialManagerDialogControllerImpl, so cancelling on any bubble hide would abort unrelated in-flight auth.

Suggested regression tests

  1. SuccessfulPasswordChangeBubbleControllerTest — capture the delegate's AvailabilityCallback, destroy the controller, then run the captured callback; assert the user callback did not run.
  2. SuccessfulPasswordChangeViewTest — click the eye icon, capture the callback, GetWidget()->CloseNow(), then run the callback; passes clean under ASan.

The original report as published on the Chromium issue tracker, by shab. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 passed a callback holding raw view pointers to an asynchronous authenticator without wrapping it in its own WeakPtrFactory, and bubble-hide paths other than navigation did not cancel the pending authentication.

Impact

A heap use-after-free in the unsandboxed browser process could crash the browser and, with heap grooming, potentially yield a control-flow or write primitive, though it requires local user interaction and a second action to close the bubble.

What the attacker needed

Local user interaction; password change bubble shown; OS reauth prompt pending; bubble closed without navigating

The fix

The callback should be bound through the controller's WeakPtrFactory, matching sibling controllers, so it is never invoked after the bubble and its views are destroyed.

How it was found

  1. Complete an automated password change so the success bubble appears.
  2. Click the eye icon to trigger the OS reauthentication prompt.
  3. Without dismissing the prompt, switch tabs so the bubble disappears.
  4. Return to the prompt and cancel or authenticate to run the stale callback.

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 you change a password, a small pop-up offers an eye icon to reveal the new password, and clicking it asks the operating system to confirm it is really you. The code that handles the answer kept a direct reference to the pop-up's text and button instead of a safe reference that notices when they are gone. If the pop-up closed while the confirmation was still open, the answer later touched memory that had already been freed, which can crash the browser or, in theory, be abused.

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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.