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

Use after free in Autofill (CVE-2026-11131)

A use-after-free exists in the Android OTP verification dialog because the native C++ object is deleted synchronously on dismissal while the UI remains interactive during a 200ms fade-out animation. An attacker who can interact with the fading UI could trigger JNI calls on freed memory, potentially leading to remote code execution in the browser process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 53 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 Chrome Security team.

Overview: A potential Use-After-Free (UAF) exists in the Android OTP verification dialog. The native C++ object is destroyed synchronously upon dismissal, but the UI remains interactive during a 200ms fade-out animation. Interactions during this window invoke JNI methods using a stale pointer, potentially leading to Remote Code Execution in the browser process.

Affected files:

  • chrome/browser/ui/android/autofill/otp_verification_dialog_view_android.cc
  • chrome/browser/ui/android/autofill/internal/java/src/org/chromium/chrome/browser/ui/autofill/OtpVerificationDialogBridge.java
  • chrome/browser/ui/android/autofill/internal/java/src/org/chromium/chrome/browser/ui/autofill/OtpVerificationDialogMediator.java
  • components/browser_ui/modaldialog/android/java/src/org/chromium/components/browser_ui/modaldialog/TabModalPresenter.java
  • ui/android/java/src/org/chromium/ui/modaldialog/ModalDialogManager.java

Estimated timestamp from git blame: 2021-12-07

Summary

A potential Use-After-Free (UAF) vulnerability has been identified in the OTP verification dialog for Autofill Payments on Chrome for Android. The issue stems from a lifecycle mismatch: the native OtpVerificationDialogViewAndroid C++ object deletes itself synchronously when the dialog is dismissed, but the corresponding Android UI remains visible and interactive during a 200ms exit animation.

Because the native pointer is stored as a primitive long in the Java bridge (OtpVerificationDialogBridge), it is not protected by MiraclePtr (BackupRefPtr). User or attacker-induced interaction with the UI during the animation window triggers JNI calls on the freed memory, which could potentially be exploited to achieve Remote Code Execution (RCE) in the highly privileged browser process.

Technical Details

  1. Dialog Initialization: When the OTP dialog is created, OtpVerificationDialogBridge (Java) receives a raw pointer to OtpVerificationDialogViewAndroid (C++) and stores it in a primitive long field named mNativeOtpVerificationDialogView.
  2. Synchronous Destruction: When the dialog is dismissed (e.g., via the Cancel button or programmatically), ModalDialogManager.dismissDialog() synchronously triggers the controller's onDismiss callback. This propagates to the Java bridge, which calls the native JNI method onDialogDismissed. The C++ method OtpVerificationDialogViewAndroid::OnDialogDismissed executes delete this;, freeing the native object's memory.
  3. Asynchronous UI Teardown: Immediately after notifying the controller, ModalDialogManager instructs TabModalPresenter to remove the view. Because the view is attached, TabModalPresenter initiates a 200ms alpha fade-out animation (runExitAnimation). During this 200ms window, the view is not hidden, and its click listeners (such as the ChromeClickableSpan for the "Get new code" link) are not disabled.
  4. Triggering the UAF: If an interaction occurs on the fading UI during this 200ms window (e.g., tapping "Get new code"), the Java bridge blindly passes the dangling mNativeOtpVerificationDialogView pointer across JNI to OtpVerificationDialogViewAndroid::OnNewOtpRequested.
  5. Exploitation Path: Because the pointer crosses JNI as a primitive integer, MiraclePtr does not track it. An attacker capable of spraying the browser process heap (e.g., from a compromised renderer) could predictably reclaim the freed memory during the 200ms window. The C++ code evaluates if (controller_) where controller_ is a base::WeakPtr. The attacker can forge the WeakPtr and its internal Flag object to pass the validity check. The subsequent call to the pure virtual method controller_->OnNewCodeLinkClicked() reads a fake vtable from the attacker-controlled memory, leading to potential arbitrary control-flow hijacking.

Note: These steps describe a potential exploitation path based on code analysis; an active proof-of-concept exploit has not been executed.

Potential Reproduction Steps

  1. Trigger an OTP verification dialog in Chrome for Android.
  2. Initiate dismissal of the dialog (e.g., tap 'Cancel').
  3. Within the 200ms exit animation window, tap the 'Get new code' link or the 'Confirm' button.
  4. Observe a crash or unexpected behavior due to the use of the freed native object.

Proposed Fix

The Java OtpVerificationDialogBridge should clear its native pointer upon dismissal to prevent further JNI calls. Specifically, in OtpVerificationDialogBridge.java:

Java
    @Override
    public void onDialogDismissed() {
        if (mNativeOtpVerificationDialogView == 0) return;
        OtpVerificationDialogBridgeJni.get().onDialogDismissed(mNativeOtpVerificationDialogView);
        // Add this line to clear the pointer:
        mNativeOtpVerificationDialogView = 0;
    }

All other methods in OtpVerificationDialogBridge that call into native (e.g., onConfirm, onNewOtpRequested) should check if mNativeOtpVerificationDialogView != 0 before proceeding. Additionally, TabModalPresenter should consider disabling interaction (e.g., via setClickable(false)) on the dialog container immediately when an exit animation begins.

Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b


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 native object is deleted synchronously on dismissal while the Java bridge keeps a raw pointer and the UI remains interactive during the exit animation, so later JNI calls use freed memory.

Impact

An attacker capable of spraying the browser process heap could potentially reclaim the freed memory and hijack control flow, leading to remote code execution in the browser process; however, no active proof-of-concept exploit has been executed.

What the attacker needed

Chrome for Android; OTP verification dialog is shown; attacker can spray browser heap; interaction during 200ms animation

The fix

The Java bridge should clear its native pointer upon dismissal and check it before any JNI call, and the dialog container should be made non-clickable when the exit animation begins.

How it was found

  1. Trigger an OTP verification dialog in Chrome for Android.
  2. Initiate dismissal of the dialog (e.g., tap 'Cancel').
  3. Within the 200ms exit animation window, tap the 'Get new code' link or the 'Confirm' button.
  4. Observe a crash or unexpected behavior due to the use of the freed native object.

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 still uses it later, like deleting a file and then trying to open it. Here, the dialog's underlying code is deleted as soon as you close it, but the on-screen buttons stay clickable for a short animation. If someone clicks during that time, the program tries to use the deleted code, which can crash or, in theory, 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.