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

Use after free in WebView (CVE-2026-11080)

A use-after-free occurs in Android WebView when a permission request is cancelled and the embedder's cancellation callback synchronously calls deny() or grant(), freeing the native object while a cached raw pointer is still used. An attacker could crash the browser process by triggering a permission request and then navigating away, though remote code execution is considered extremely difficult.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 58 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 security team.

Overview: A Use-After-Free (UAF) vulnerability exists in the Android WebView browser process when a permission request is canceled. If an embedder application defensively calls grant() or deny() during the cancellation callback, the native object is synchronously deleted, leaving a dangling stack pointer that is subsequently accessed.

Affected files:

  • android_webview/browser/permission/permission_request_handler.cc
  • android_webview/browser/permission/aw_permission_request.cc
  • android_webview/java/src/org/chromium/android_webview/CleanupReference.java
  • android_webview/java/src/org/chromium/android_webview/permission/AwPermissionRequest.java

Estimated timestamp from git blame: 2015-05-06

Summary

A Use-After-Free (UAF) vulnerability exists in the Android WebView browser process within PermissionRequestHandler::CancelRequestInternal. The function caches a raw pointer to an AwPermissionRequest object and then performs a synchronous JNI call into the embedder application's code. If the embedder application calls request.deny() or request.grant() inside the onPermissionRequestCanceled callback, the native AwPermissionRequest object is synchronously deleted. When the JNI call returns, the cached pointer is dereferenced, leading to a UAF.

Technical Details

In android_webview/browser/permission/permission_request_handler.cc, the CancelRequestInternal function caches a raw stack pointer to the request:

C++
void PermissionRequestHandler::CancelRequestInternal(RequestIterator i) {
  AwPermissionRequest* request = i->get(); // Caches raw stack pointer
  if (request) {
    client_->OnPermissionRequestCanceled(request); // Synchronous JNI callback
    request->CancelAndDelete(); // UAF happens here
  }
}

The OnPermissionRequestCanceled call ultimately triggers a synchronous JNI callback to the Java method onPermissionRequestCanceled in the embedder's WebChromeClient.

If the embedder application calls deny() or grant() on the provided PermissionRequest adapter within this callback, it triggers a synchronous deletion chain in Java:

  1. AwPermissionRequest.deny() calls destroyNative().
  2. destroyNative() invokes mCleanupReference.cleanupNow().
  3. Since this occurs on the UI thread, the cleanup task executes synchronously instead of posting to the looper.
  4. The cleanup task invokes AwPermissionRequestJni.get().destroy(nativeAwPermissionRequest).
  5. The native AwPermissionRequest::Destroy method executes delete this;.

At this point, the AwPermissionRequest object is freed. However, PermissionRequestHandler::CancelRequestInternal still holds the cached raw pointer request on the stack. Because it is a local stack pointer rather than a class member, it bypasses MiraclePtr (BackupRefPtr) protections.

Upon returning from the JNI call, request->CancelAndDelete() is executed on the freed memory, causing a UAF write (processed_ = true) and a UAF read (retrieving the Java object reference).

Potential Attack Vector

  1. A malicious web page loaded in a WebView requests a permission (e.g., MIDI SysEx).
  2. The page triggers a navigation to a different origin.
  3. The navigation causes PermissionRequestHandler::CancelAllRequests to be called, which invokes CancelRequestInternal.
  4. The embedder app's defensive onPermissionRequestCanceled handler calls deny() on the canceled request.
  5. The UAF is triggered upon returning to C++.

While achieving Remote Code Execution is extremely difficult due to the inability to run the message loop and reallocate memory synchronously during the callback, the vulnerability reliably crashes the browser process and represents a valid memory safety violation.

Suggested Fix

Use a base::WeakPtr to verify the object is still alive after the synchronous callback returns.

C++
void PermissionRequestHandler::CancelRequestInternal(RequestIterator i) {
  base::WeakPtr<AwPermissionRequest> request = *i;
  if (request) {
    client_->OnPermissionRequestCanceled(request.get());
    if (request) {
      request->CancelAndDelete();
    }
  }
}

Evaluated with Chrome root at commit: f200f57a19490707ff8bc7aa5de3cbc443a3afad


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

The code caches a raw pointer to an object, makes a synchronous callback that can delete the object, and then dereferences the stale pointer.

Impact

The vulnerability reliably crashes the browser process, but remote code execution is extremely difficult due to the inability to run the message loop and reallocate memory synchronously during the callback.

What the attacker needed

WebView with a permission request; Embedder calls deny() or grant() in callback; Victim loads a malicious page

The fix

Use a `base::WeakPtr` to verify the object is still alive after the synchronous callback returns.

How it was found

  1. A malicious web page loaded in a WebView requests a permission (e.g., MIDI SysEx).
  2. The page triggers a navigation to a different origin.
  3. The navigation causes `PermissionRequestHandler::CancelAllRequests` to be called, which invokes `CancelRequestInternal`.
  4. The embedder app's defensive `onPermissionRequestCanceled` handler calls `deny()` on the canceled request.
  5. The UAF is triggered upon returning to C++.

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 a memory bug where a program keeps using a piece of memory after it has been freed. Here, WebView frees a permission request object during a callback, then tries to use it again, which can crash the app. An attacker can trigger this by making a web page request a permission and then navigate away.

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.