Use after free in Payments (CVE-2026-15117)
A use-after-free was identified in the browser process of SecurePaymentConfirmationController: calling CloseDialog() can synchronously destroy the hosting WebContents, the PaymentRequest and the controller itself, after which the handler reads and copies the freed request_ pointer. An attacker could potentially trigger this by getting an SPC dialog shown inside an extension popup and having the user cancel or opt out, leading to a browser-process use-after-free.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 28 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 due to synchronous reentrancy inside SecurePaymentConfirmationController. Calling CloseDialog() on the controller can synchronously trigger window activation events that destroy the hosting WebContents, the DocumentService PaymentRequest, and the controller itself. Unwinding back to the controller's handlers leads to a UAF read and copy of the freed controller's request_ pointer.
Affected files:
components/payments/content/secure_payment_confirmation_controller.ccchrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.ccchrome/browser/payments/chrome_payment_request_delegate.cccomponents/payments/content/payment_request.cc
Estimated timestamp from git blame: 2020-08-27
Root Cause Analysis
Four user-interaction handlers in SecurePaymentConfirmationController (OnCancel, OnAnotherWay, OnOptOut, and the error branch of OnConfirm) call CloseDialog() and then dereference/copy request_ (which is this->request_) without first verifying that the controller instance (this) is still alive:
// components/payments/content/secure_payment_confirmation_controller.cc:177-200
void SecurePaymentConfirmationController::OnCancel() {
if (!is_dialog_showing_) { return; }
...
is_dialog_showing_ = false;
CloseDialog(); // [1] Can synchronously free `this`
if (!request_) { // [2] UAF read of this->request_
return;
}
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(&PaymentRequest::OnUserCancelled,
request_)); // [3] UAF copy of this->request_
}
CloseDialog() calls view_->HideDialog(), which invokes Widget::Close(). Under certain circumstances—such as when the dialog is hosted inside an extension popup—closing the widget shifts native activation. This activation shift can synchronously trigger ExtensionPopup::OnWidgetTreeActivated, which closes the popup window and destroys its hosting WebContents because the active web modal check is bypassed once the dialog is erased from the modal manager's list.
Because PaymentRequest is a frame-bound Mojo DocumentService, the destruction of the WebContents results in ~PaymentRequest(), which calls ChromePaymentRequestDelegate::CloseDialog() and resets the std::unique_ptr<SecurePaymentConfirmationController> (spc_dialog_). This deletes the controller, leaving a dangling this on the stack when execution unwinds back to the handlers.
Potential Trigger Steps
Note: These are potential, suggested steps to reproduce the issue. Our analysis is based on static code tracing, and we do not have a running proof of concept.
- An extension popup embeds an attacker-influenced HTTPS
<iframe>or page. - The page calls the Secure Payment Confirmation API via
new PaymentRequest(...)to display the SPC dialog on the popup's WebContents. - The user interacts with the dialog, clicking Cancel or Opt-out.
- The controller's callback
OnCancel()(orOnOptOut()) is triggered. - The controller calls
CloseDialog(), which synchronously initiates the popup widget destruction chain. - The popup's
WebContentsis destroyed, which synchronously deletes thePaymentRequestDocumentService. ~PaymentRequest()triggersChromePaymentRequestDelegate::CloseDialog(), resetting the unique pointer holding theSecurePaymentConfirmationController.- Execution returns to
OnCancel(), resulting in a browser-process Use-After-Free when checkingif (!request_)and copyingrequest_.
Proposed Fix
To prevent synchronous destruction from causing a UAF, the handlers must use a self-WeakPtr guard to check if this remains alive after CloseDialog() is executed, matching in-tree precedents in sibling modules (such as AuthenticatorCommonImpl and DigitalIdentityRequestImpl).
void SecurePaymentConfirmationController::OnCancel() {
if (!is_dialog_showing_) {
return;
}
...
is_dialog_showing_ = false;
base::WeakPtr<SecurePaymentConfirmationController> weak_this = GetWeakPtr();
CloseDialog();
if (!weak_this) {
return;
}
if (!request_) {
return;
}
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(&PaymentRequest::OnUserCancelled, request_));
}
Evaluated with Chrome root at commit: b2fea2e31df308d0f04e4ae47def4c4f939ee141
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 handlers call CloseDialog() and then dereference request_ without checking whether the controller itself was synchronously destroyed during that call.
Impact
A browser-process use-after-free could potentially be exploited for memory corruption, though the report only describes static analysis and no working proof of concept.
What the attacker needed
Extension popup hosting the dialog; attacker-influenced page in the popup; victim clicks Cancel or Opt-out
The fix
The handlers should take a self-WeakPtr before calling CloseDialog() and return early if the controller was destroyed, as shown in the proposed patch.
How it was found
- An extension popup embeds an attacker-influenced HTTPS iframe or page.
- The page calls the Secure Payment Confirmation API to display the SPC dialog on the popup's WebContents.
- The user clicks Cancel or Opt-out on the dialog.
- The controller's OnCancel or OnOptOut callback runs and calls CloseDialog(), which starts synchronous destruction of the popup widget.
- The popup's WebContents is destroyed, which deletes the PaymentRequest DocumentService and resets the pointer holding the controller.
- Execution returns to the handler, which reads and copies the freed request_ pointer, causing a browser-process 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.
A use-after-free happens when a program frees some memory and then keeps using it, like deleting a file and still reading from it. Here, closing a payment dialog can cause the whole page and the object handling the dialog to be destroyed straight away, but the code then carries on and touches that destroyed object. The report is based on reading the code, not on a working demonstration, so it is a suspected flaw rather than a proven attack.
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.