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

Insufficient data validation in Passwords (CVE-2026-14009)

A use-after-free was identified in Chrome's password autofill code, where a synchronous DOM event dispatched during field filling can run page script that detaches the iframe and enters a nested run loop, destroying the agent object while its method is still on the stack. An attacker could potentially exploit this to access freed memory, though the report notes no working proof-of-concept was built.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 36 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 PasswordAutofillAgent due to synchronous DOM events dispatched inside DoFillField. By triggering a nested run loop (via window.print()) during a synchronous event listener and subsequently detaching the iframe, the PasswordAutofillAgent object can be destroyed while its methods remain on the call stack. Upon exiting the nested run loop, execution resumes inside a freed this context, leading to a Use-After-Free.

Affected files:

  • components/autofill/content/renderer/password_autofill_agent.cc
  • components/autofill/content/renderer/password_autofill_agent.h

Estimated timestamp from git blame: 2024-02-27

Bug Analysis & Root Cause

In components/autofill/content/renderer/password_autofill_agent.cc, the function PasswordAutofillAgent::DoFillField is responsible for autofilling credentials into DOM input fields:

C++
void PasswordAutofillAgent::DoFillField(WebInputElement input,
                                        const std::u16string& credential,
                                        FieldPropertiesMask field_properties) {
  CHECK(input);
  input.SetAutofillValue(WebString::FromUtf16(credential)); // <--- Synchronous DOM Event Dispatch
  field_data_manager().UpdateFieldDataMap(...);              // <--- Use-After-Free
  ...
  TrackAutofilledElement(input);
}

Calling input.SetAutofillValue() triggers Blink to update the input's value and synchronously dispatch input and change DOM events. A malicious page can register a synchronous event listener on the input field. When this listener is invoked, it can initiate frame teardown and immediately enter a nested run loop by invoking window.print().

Potential Exploitation Mechanism

An attacker could potentially trigger the Use-After-Free using the following sequence of events:

  1. A parent document (Origin A) embeds a cross-origin login iframe (Origin B).
  2. Origin B registers a synchronous change event listener on its username input element.
  3. The user interacts with the iframe and triggers Chrome's password autofill.
  4. PasswordAutofillAgent::DoFillField is called, which calls input.SetAutofillValue(...).
  5. Blink synchronously dispatches the change event, executing the page's event listener in Origin B.
  6. The event listener calls window.parent.postMessage('detach', '*') and immediately invokes window.print().
  7. window.print() enters PrintRenderFrameHelper::ScriptedPrint and spins a nested message loop with nestable tasks allowed (base::RunLoop::Type::kNestableTasksAllowed).
  8. The parent frame receives the postMessage and removes the iframe from the DOM.
  9. The browser process sends a mojom::Frame::Delete IPC to the child renderer, which is processed immediately within the nested run loop.
  10. RenderFrameImpl::Delete detaches the frame, invoking OnDestruct() on AutofillAgent. This posts a DeleteSoon task to the default queue, which executes immediately inside the nested run loop.
  11. When AutofillAgent is destroyed, its owned PasswordAutofillAgent is also destroyed.
  12. Due to class-member destruction order in AutofillAgent, FormTracker is destroyed before PasswordAutofillAgent, releasing any raw_ref or raw_ptr references to it and dropping the BackupRefPtr reference count to 0. This bypasses the BackupRefPtr quarantine, deallocating the memory immediately.
  13. Once the print dialog is dismissed and the nested loop terminates, execution unwinds back to DoFillField.
  14. The call to field_data_manager() is made on a freed this pointer, resulting in a Use-After-Free.

Note: Our tooling does not currently have the capability to run code or compile a working proof-of-concept, so these steps represent a potential and theoretical attack vector based on static code path analysis.

Suggested Remediation

To prevent this issue, PasswordAutofillAgent should be tracked using a base::WeakPtr to verify liveness after returning from operations that execute arbitrary page JavaScript. Alternatively, avoid calling field_data_manager() or making member accesses on this after SetAutofillValue without verifying if the frame observer or agent is still valid, or leverage a weak pointer pattern like base::WeakPtrFactory in PasswordAutofillAgent to exit gracefully if this has been destroyed.

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.

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 a function that synchronously dispatches DOM events, allowing page script to destroy the object before the method finishes using its members.

Impact

An attacker could potentially cause a use-after-free, which may lead to memory corruption or code execution, but the report states no working proof-of-concept was built.

What the attacker needed

Victim uses Chrome password autofill; attacker controls a cross-origin iframe; user interaction with the iframe

The fix

The agent should be tracked with a weak pointer to check liveness after operations that run page JavaScript, or member accesses after SetAutofillValue should be avoided without verifying validity.

How it was found

  1. A parent document embeds a cross-origin login iframe.
  2. The iframe registers a synchronous change event listener on its username input.
  3. The user triggers Chrome's password autofill in the iframe.
  4. The event listener posts a message to the parent and calls window.print(), entering a nested run loop.
  5. The parent removes the iframe, causing the agent object to be destroyed inside the nested loop.
  6. After the print dialog closes, execution returns to the freed object, causing a use-after-free.

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 a website fills in a password field, the browser runs some code that can trigger events on the page. A malicious page can use those events to make the browser close the part of the page that owns that code while it is still running. This leaves the code using memory that has already been freed, which is called a use-after-free and can sometimes let an attacker run their own 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.