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

Use after free in Payments (CVE-2026-6319)

A use-after-free occurs in Chrome's PaymentsWindowBridge because the Java object keeps a native pointer that is never cleared when the C++ object is destroyed. An attacker could crash the browser process by closing the merchant tab while an ephemeral payment tab is open.

pwn2addr Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 14 days

Steps to reproduce the problem

Continued from https://issues.chromium.org/issues/498289905.

  1. Checkout and apply the patch:
git checkout 14e903b7ea5de658e62e89cd56ca758a5a0c2428
git apply patch3.diff
  1. Build Chromium for Android:
gn gen out/Default --args='target_os="android" target_cpu="arm64" is_debug=false use_siso=false android_static_analysis="off"'
autoninja -C out/Default chrome_public_apk
  1. Install on a device (connect an ARM64 Android device via adb):
out/Default/bin/chrome_public_apk install
  1. Start the MITM proxy on the host machine:
pip install mitmproxy
mitmproxy --mode regular --listen-port 8080 -s mitm_bnpl.py
  1. Host the PoC files (poc.html, poc_checkout.html, bnpl_page.html):
python3 -m http.server 8888
  1. Launch Chrome:
out/Default/bin/chrome_public_apk run \
  --args='--enable-features=AutofillEnableBuyNowPayLater,AutofillEnableAmountExtraction,AutofillEnableAmountExtractionTesting,AutofillDisableBnplCountryCheckForTesting,AutofillEnableBuyNowPayLaterSyncing --proxy-server=http://<host>:8080 --ignore-certificate-errors'
  1. Add a test credit card in Chrome Settings > Payment methods (Name: Test User, Number: 4111 1111 1111 1111, Expiry: 12/30).

  2. Navigate to http://<host>:8888/poc.html and click "Start PoC".

  3. In the new tab, tap the Card Number field, select the saved card from the autofill bar, and then select "Affirm" from the Pay Later options.

  4. After the ephemeral tab (bottom sheet) appears, the parent page closes the merchant tab in 10 seconds. The browser process crashes with SIGSEGV at 0xcdcdcdcdcdcdcdcd in PaymentsWindowBridge::OnWebContentsDestroyed.

Problem Description

PaymentsWindowBridge.java stores the C++ PaymentsWindowBridge pointer as a final long field:

Java
// PaymentsWindowBridge  PaymentsWindowBridge.java:19
class PaymentsWindowBridge {
    private final long mNativePaymentsWindowBridge;    // [1]
    ...
    void onWebContentsDestroyed() {
        PaymentsWindowBridgeJni.get().onWebContentsDestroyed(mNativePaymentsWindowBridge);  // [5]
    }
}

The pointer is set once in the constructor [1] and never cleared. The final keyword makes it impossible to set it to zero.

The PaymentsWindowCoordinator registers itself as an EphemeralTabObserver on the Activity-scoped EphemeralTabCoordinator:

Java
// PaymentsWindowCoordinator.openEphemeralTab  PaymentsWindowCoordinator.java:47
void openEphemeralTab(GURL url, String title, WebContents merchantWebContents) {
    ...
    WindowAndroid windowAndroid = merchantWebContents.getTopLevelNativeWindow();
    ...
    mEphemeralTabCoordinator = supplier.get();
    mEphemeralTabCoordinator.addObserver(this);   // [2]
    ...
}

The EphemeralTabCoordinator is retrieved from WindowAndroid's unowned user data [2], making it Activity-scoped -- it survives individual tab closures.

The C++ ownership chain is:

WebContents (merchant tab)
  -> ContentAutofillClient (WebContentsUserData)
    -> ChromeAutofillClient (extends ContentAutofillClient)
      -> ChromePaymentsAutofillClient (member)
        -> AndroidPaymentsWindowManager (unique_ptr)
          -> PaymentsWindowBridge (unique_ptr)

AndroidPaymentsWindowManager owns PaymentsWindowBridge as a unique_ptr:

C++
// AndroidPaymentsWindowManager  android_payments_window_manager.h:65
class AndroidPaymentsWindowManager : public PaymentsWindowManager,
                                     public PaymentsWindowDelegate {
  ...
  std::unique_ptr<PaymentsWindowBridge> payments_window_bridge_;   // [3]
};

The C++ destructor is defaulted and does not notify the Java side:

C++
// PaymentsWindowBridge::~PaymentsWindowBridge  payments_window_bridge.cc:30
PaymentsWindowBridge::~PaymentsWindowBridge() = default;   // [4]

When the merchant tab is closed, ~WebContentsImpl destroys WebContentsUserData entries, which chains through ~ChromeAutofillClient -> ~ChromePaymentsAutofillClient -> ~AndroidPaymentsWindowManager -> ~PaymentsWindowBridge [3][4]. The defaulted destructor [4] does not call into Java to null out mNativePaymentsWindowBridge, nor does it remove the PaymentsWindowCoordinator from the EphemeralTabCoordinator's observer list.

Subsequently, when the ephemeral tab's WebContents is cleaned up, PaymentsWindowCoordinator.onWebContentsDestroyed() fires through the observer registered at [2], which calls PaymentsWindowBridge.onWebContentsDestroyed() [5], passing the dangling mNativePaymentsWindowBridge to JNI. The C++ side then dereferences payments_window_delegate_ on the freed object:

C++
// PaymentsWindowBridge::OnWebContentsDestroyed  payments_window_bridge.cc:66-68
void PaymentsWindowBridge::OnWebContentsDestroyed(JNIEnv* env) {
  payments_window_delegate_->WebContentsDestroyed();   // [6] UAF: `this` is freed
}

The crash occurs at [6] because this was freed at [4], and payments_window_delegate_ (a raw_ref) now contains 0xcdcdcdcdcdcdcdcd.

The same pattern was previously found and fixed in FacilitatedPaymentsPaymentMethodsControllerBridge (crbug.com/355139788). That fix made the native pointer non-final, added an onNativeDestroyed() callback to zero it out, and guarded every JNI callback with a null check. None of these protections were applied to PaymentsWindowBridge.

[1] https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/android/autofill/internal/java/src/org/chromium/chrome/browser/ui/autofill/ephemeraltab/PaymentsWindowBridge.java;l=19;drc=14e903b7ea5de658e62e89cd56ca758a5a0c2428

[2] https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/android/autofill/internal/java/src/org/chromium/chrome/browser/ui/autofill/ephemeraltab/PaymentsWindowCoordinator.java;l=56;drc=14e903b7ea5de658e62e89cd56ca758a5a0c2428

[3] https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/autofill/payments/android_payments_window_manager.h;l=65;drc=14e903b7ea5de658e62e89cd56ca758a5a0c2428

[4] https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/android/autofill/payments/payments_window_bridge.cc;l=30;drc=14e903b7ea5de658e62e89cd56ca758a5a0c2428

[5] https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/android/autofill/internal/java/src/org/chromium/chrome/browser/ui/autofill/ephemeraltab/PaymentsWindowBridge.java;l=73;drc=14e903b7ea5de658e62e89cd56ca758a5a0c2428

[6] https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/android/autofill/payments/payments_window_bridge.cc;l=66;drc=14e903b7ea5de658e62e89cd56ca758a5a0c2428

Additional Comments

If a signed-in Chrome instance with a US-based Google account, a linked BNPL issuer (e.g., Affirm), and a BNPL-eligible merchant page is available, this bug can be triggered from poc.html with no patches. I don't have such account, so I used patch to reproduce. If you still think this patch inappropriate, please let me know in the comments.

Summary

Use-After-Free via dangling JNI native pointer in PaymentsWindowBridge::OnWebContentsDestroyed

Custom Questions

Type of crash:

browser

Crash state:

Please see the attached tombstone.txt

Reporter credit:

pwn2addr

Additional Data

Category: Security
Chrome Channel: Not sure
Regression: N/A \

The original report as published on the Chromium issue tracker, by pwn2addr. 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 Java PaymentsWindowBridge stores a final native pointer that is not cleared when the C++ object is destroyed, and the observer is not removed, leading to a dangling pointer dereference.

What the attacker needed

Android device with ARM64; Chrome built with specific flags; MITM proxy setup; Test credit card added

The fix

The fix should make the native pointer non-final, add an onNativeDestroyed callback to zero it out, and guard every JNI callback with a null check, as was done for FacilitatedPaymentsPaymentMethodsControllerBridge.

How it was found

  1. Checkout and apply the patch.
  2. Build Chromium for Android.
  3. Install on a device.
  4. Start the MITM proxy on the host machine.
  5. Host the PoC files.
  6. Launch Chrome with the specified flags.

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 is when a program keeps using memory it has already freed. Here, a Java object holds a pointer to a C++ object that gets destroyed when a tab closes, but the pointer is never set to null. Later, when another tab closes, the program tries to use that stale pointer and crashes.

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 by pwn2addr

View all

71 more disclosed reports, best first.

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.