Use after free Autofill (CVE-2026-12015)
A request structure in the Autofill BNPL flow stored device fingerprinting data as a non-owning string view rather than an owning string. If the frame was navigated away during an asynchronous OAuth token fetch, the owning object was destroyed and the later request build read freed memory in the browser process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 22 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 heap-use-after-free read vulnerability exists in the browser process within the Autofill BNPL implementation. A non-owning std::string_view in a network request structure can become dangling if the parent BnplManager is destroyed during an asynchronous OAuth token fetch.
Affected files:
components/autofill/core/browser/payments/payments_request_details.hcomponents/autofill/core/browser/payments/bnpl_manager.cccomponents/autofill/core/browser/payments/payments_network_interface_base.cccomponents/autofill/core/browser/payments/payments_requests/get_bnpl_payment_instrument_for_fetching_url_request.cccomponents/autofill/core/browser/foundations/browser_autofill_manager.cc
Estimated timestamp from git blame: 2025-01-20
Technical Description
A potential heap-use-after-free (UAF) read has been identified in the browser process in the Buy Now, Pay Later (BNPL) Autofill flow. The issue arises from the use of a non-owning std::string_view in the GetBnplPaymentInstrumentForFetchingUrlRequestDetails structure, which stores device fingerprinting data (risk_data).
Vulnerability Mechanism
In components/autofill/core/browser/payments/payments_request_details.h (line 518), the struct GetBnplPaymentInstrumentForFetchingUrlRequestDetails stores risk_data as a std::string_view. This is inconsistent with other request structures in the same file that use owning std::string objects for similar data.
During a BNPL flow, BnplManager::FetchRedirectUrl() populates this structure, assigning the risk_data view to a string owned by OngoingFlowState, which is managed by BnplManager. BnplManager is a per-frame object (owned by BrowserAutofillManager).
The request is then passed to PaymentsNetworkInterface, which is a per-WebContents object. If the network request requires an asynchronous OAuth token fetch, the interface initiates the fetch and returns control to the event loop.
The UAF Trigger
If the frame is navigated or detached while the OAuth token fetch is pending, BrowserAutofillManager::Reset() is called, which destroys the BnplManager. Crucially, the BnplManager destructor is the default implementation and does not explicitly cancel ongoing requests in the PaymentsNetworkInterface.
When BnplManager is destroyed, its OngoingFlowState is deleted, and the backing std::string for risk_data is freed. Once the token fetch completes, PaymentsNetworkInterfaceBase::SetOAuth2TokenAndStartRequest() calls request_->GetRequestContent(). In get_bnpl_payment_instrument_for_fetching_url_request.cc, this implementation dereferences the now-dangling std::string_view to build the JSON request body, leading to a heap-UAF read.
Potential Impact
This results in a heap-use-after-free read in the privileged browser process. A compromised renderer could potentially exploit this by grooming the heap during the asynchronous window to exfiltrate browser process memory contents via the resulting network request. This issue also causes a browser process crash (Denial of Service). As std::string_view does not use raw_ptr, this is not protected by MiraclePtr.
Suggested Potential Reproduction Steps
- Use a Chrome build with BNPL features enabled.
- Trigger a BNPL flow on a merchant site (e.g., by selecting a BNPL issuer from Autofill suggestions).
- While the browser is fetching redirect details (specifically during the OAuth token fetch phase), navigate the tab or remove the associated iframe (e.g., using
window.location.href = ...oriframe.remove()). - If the OAuth token was not previously cached, the completion of the fetch should trigger a dereference of the freed memory in the browser process.
Recommended Fix
The GetBnplPaymentInstrumentForFetchingUrlRequestDetails structure should be updated to use an owning std::string for the risk_data field, matching the design of GetBnplPaymentInstrumentForFetchingVcnRequestDetails and other sibling structures. Additionally, the BnplManager destructor should ensure all pending requests are cancelled.
Evaluated with Chrome root at commit: 29093e11cf509e3593f6229e4b1b075cca356049
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
Likely the request details struct held a non-owning string view into state owned by a per-frame manager that could be destroyed before the asynchronous request was built, and the destructor did not cancel pending requests.
Impact
A compromised renderer could potentially use the freed memory to exfiltrate browser process memory through the resulting network request, and the issue also causes a browser process crash; the text notes the view is not protected by MiraclePtr.
What the attacker needed
BNPL features enabled in Chrome; victim starts a BNPL flow; no cached OAuth token; frame navigated or removed mid-fetch
The fix
The struct should use an owning string for the risk data, matching sibling structures, and the manager destructor should cancel pending requests.
How it was found
- Use a Chrome build with BNPL features enabled.
- Start a BNPL flow on a merchant site from the Autofill suggestions.
- During the OAuth token fetch, navigate the tab or remove the iframe.
- With no cached token, completion of the fetch dereferences the freed memory.
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.
Some code keeps a pointer-like reference to text stored elsewhere instead of keeping its own copy. If the original text is deleted while a slow network step is still running, the later code reads memory that no longer belongs to it, which is called a use-after-free. Here that could crash the browser, and in theory leak memory contents into a network request.
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.