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

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

A use-after-free vulnerability exists in the browser process because PasswordFormManager::OnFetchCompleted calls FillNow(), which can synchronously destroy the object, and then accesses freed memory. An attacker could potentially exploit this to achieve remote code execution and sandbox escape.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 34 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 security team.

Overview: A potential Use-After-Free (UAF) vulnerability exists in the browser process due to synchronous object destruction within PasswordFormManager::OnFetchCompleted. An attacker can manipulate UI states to free the object while its method is still executing, leading to an exploitable UAF virtual call. This could potentially result in Remote Code Execution (RCE) and a sandbox escape.

Affected files:

  • components/password_manager/core/browser/password_form_manager.cc

Estimated timestamp from git blame: 2024-02-09

Description

A potential Use-After-Free (UAF) vulnerability exists in components/password_manager/core/browser/password_form_manager.cc within the browser process.

The function PasswordFormManager::OnFetchCompleted() contains a critical flaw where it calls FillNow() and subsequently accesses its own member variables (should_schedule_save_for_later_) and methods (Save()). The FillNow() method explicitly warns developers that it can trigger the synchronous destruction of the PasswordFormManager instance. If destruction occurs, the execution returning to OnFetchCompleted() will operate on freed memory.

C++
void PasswordFormManager::OnFetchCompleted() {
  // ...
  if (...) {
    FillNow(); // Can synchronously destroy `this`
  }

  // UAF Read 
  if (should_schedule_save_for_later_) {
    should_schedule_save_for_later_ = false;
    Save(); // UAF Call -> triggers virtual call on raw_ptr
  }
}

Root Cause Analysis

The PasswordFormManager can be synchronously destroyed if FillNow() leads to an autofill UI notification while the UI is in a specific state.

When FillNow() executes, it calls SendFillInformationToRenderer(). If previous credentials exist for the site, this triggers ManagePasswordsUIController::OnPasswordAutofilled(). Normally, this controller ignores autofill events if it is displaying a save prompt (PENDING_PASSWORD_STATE or SAVE_CONFIRMATION_STATE). However, if the user hides the save bubble, the UI transitions to MANAGE_STATE without freeing the PasswordFormManager.

If the delayed fetch completes while in MANAGE_STATE, ManagePasswordsUIController accepts the autofill event and calls ManagePasswordsState::ClearData(). This function executes form_manager_.reset(), synchronously deleting the executing PasswordFormManager.

Because the object is managed by a std::unique_ptr and has no active raw_ptr references to it globally, MiraclePtr (BackupRefPtr) does not quarantine the allocation. The this pointer on the stack becomes dangling.

Suggested Potential Steps to Reproduce

Note: These are suggested/potential steps derived from code analysis. Our tooling agent does not yet have the ability to run code, so a working Proof of Concept has not been executed.

  1. Precondition: The user visits an attacker-controlled site where they have previously saved credentials.
  2. Generate Password: The user interacts with a registration form and uses Chrome's built-in password generator. Chrome creates a PasswordFormManager, begins fetching stored credentials, and shows the "Save Password" confirmation bubble.
  3. Delay and Hide: The attacker artificially delays the completion of the credential fetch. The user hides the save bubble (e.g., by clicking elsewhere or switching tabs), transitioning the UI to MANAGE_STATE while the fetch is still pending.
  4. Trigger UAF: The attacker releases the delay, completing the fetch. OnFetchCompleted() fires and calls FillNow(). Because the UI is in MANAGE_STATE, the resulting autofill notification triggers ManagePasswordsState::ClearData(), destroying the PasswordFormManager.
  5. Exploitation: Execution unwinds to OnFetchCompleted(). The attacker grooms the heap to reallocate the freed object, setting the should_schedule_save_for_later_ byte to true. OnFetchCompleted calls Save(), which attempts to invoke the virtual method form_fetcher_->GetState(). The attacker overwrites the form_fetcher_ pointer in the reallocated memory, hijacking the virtual call to achieve Remote Code Execution (RCE) in the browser process.

Suggested Fix

To prevent this UAF, PasswordFormManager should not execute any logic after calling FillNow().

The safest mitigation is to use a base::WeakPtr to track the object's lifetime across the FillNow() call:

C++
void PasswordFormManager::OnFetchCompleted() {
  // ... 
  base::WeakPtr<PasswordFormManager> weak_this = weak_ptr_factory_.GetWeakPtr();

  if (...) {
    FillNow();
  }

  if (!weak_this) {
    return; // Object was destroyed during FillNow()
  }

  if (should_schedule_save_for_later_) {
    should_schedule_save_for_later_ = false;
    Save();
  }
}

Alternatively, investigate if Save() can be scheduled asynchronously or if the should_schedule_save_for_later_ logic can be moved prior to FillNow().

Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33


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.

The original report as published on the Chromium issue tracker. 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 code calls FillNow() which can synchronously destroy the PasswordFormManager object, and then continues to access member variables and call methods on the freed memory.

Impact

This could potentially result in Remote Code Execution (RCE) and a sandbox escape.

What the attacker needed

Attacker-controlled website; user has saved credentials; user uses password generator; user hides save bubble

The fix

The fix should use a base::WeakPtr to check if the object was destroyed after FillNow() and return early if so.

How it was found

  1. The user visits an attacker-controlled site where they have previously saved credentials.
  2. The user interacts with a registration form and uses Chrome's built-in password generator, creating a PasswordFormManager and showing a save bubble.
  3. The attacker delays the credential fetch, and the user hides the save bubble, transitioning the UI to MANAGE_STATE.
  4. The attacker releases the delay, completing the fetch, and OnFetchCompleted calls FillNow(), which triggers ClearData() and destroys the PasswordFormManager.
  5. Execution returns to OnFetchCompleted, and the attacker grooms the heap to reallocate the freed object and hijack a virtual call for RCE.

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 then keeps using it, like deleting a file and then trying to open it. Here, a password manager object can be deleted while a function is still running, and the function then reads or calls methods on the deleted object. An attacker who can control the timing might trick the program into running malicious 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.

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.