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

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

A race condition in AwPacProcessor allows an asynchronous Android network callback to run after the native object is freed, passing a dangling pointer through JNI. A local malicious app with VpnService permission could exploit this use-after-free to achieve arbitrary code execution in the privileged PAC processor service.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 2 months

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 race condition in AwPacProcessor allows an asynchronous Android network callback to execute after the underlying native object is destroyed. This causes a dangling pointer to be passed through JNI, leading to a potential Use-After-Free (UAF). A local malicious app could exploit this to achieve arbitrary code execution in the highly privileged Android PAC processor service (UID 1000).

Affected files:

  • android_webview/java/src/org/chromium/android_webview/AwPacProcessor.java
  • android_webview/browser/aw_pac_processor.cc
  • android_webview/browser/aw_pac_processor.h

Estimated timestamp from git blame: 2025-06-30

Description

A race condition exists in AwPacProcessor.java between the destroy() method and asynchronous ConnectivityManager callbacks. This leads to a potential Use-After-Free (UAF) vulnerability where native C++ methods are called on a deleted object.

When AwPacProcessor.destroy() is called, it unregisters the network callback and immediately deletes the native C++ object (destroyNative). However, Android's unregisterNetworkCallback does not purge pending onLinkPropertiesChanged callbacks already queued on the ConnectivityThread's MessageQueue.

Because AwPacProcessor lacks a destruction flag (and mNativePacProcessor is a final long that cannot be cleared), any delayed callback will execute successfully and pass the dangling pointer via JNI to AwPacProcessorJni.get().setNetworkAndLinkAddresses().

Potential Exploitation Steps

Note: These are potential steps; our tooling agent does not have the ability to run code to verify a live proof of concept.

  1. Triggering the Race: A local attacker app granted VpnService permission establishes a VPN and rapidly adds/removes IP addresses, flooding the ConnectivityThread with callbacks.
  2. Freeing the Object: The system gracefully destroys the AwPacProcessor. The 40-byte C++ object is freed into a 48-byte PartitionAlloc bucket.
  3. Late Execution: A delayed callback fires, extracting the attacker-controlled VPN IP addresses and passing them through JNI.
  4. Heap Reclamation: The generated JNI stub converts the Java List<String> to a C++ std::vector<std::string>. If the attacker provides exactly two IP addresses, this allocates exactly 48 bytes, reliably reclaiming the recently freed AwPacProcessor object.
  5. Pointer Forgery: The first IP address is copied into the first std::string. Under Chromium's libc++ (ABI v2), Small String Optimization (SSO) places the character data at offset 0. Characters 8-15 of the attacker's string perfectly overlap the host_resolver_ pointer field of the reclaimed object.
  6. UAF Execution: The JNI stub casts the dangling long to an AwPacProcessor* and calls SetNetworkAndLinkAddresses. It reads the attacker-forged host_resolver_ pointer and posts a task using base::Unretained(host_resolver_.get()).
  7. Memory Corruption: When the background task executes HostResolver::SetNetworkAndLinkAddresses, it performs a std::vector assignment (link_addresses_ = link_addresses;) on the forged target. By controlling the target vector's pointers, the attacker achieves Arbitrary Free and Constrained Arbitrary Write primitives, ultimately leading to code execution in the com.android.pacprocessor process.

Suggested Fix

  1. Java Layer (Primary Fix): Add a private boolean mIsDestroyed = false; flag to AwPacProcessor.java. Set this flag to true inside destroy(). Check if (mIsDestroyed) return; at the beginning of onLinkPropertiesChanged() or before any native JNI calls are made to prevent using the dangling mNativePacProcessor handle.
  2. C++ Layer (Defense in Depth): Avoid using base::Unretained in AwPacProcessor::SetNetworkAndLinkAddresses when posting tasks to the HostResolver. Consider using a base::WeakPtr for the AwPacProcessor or managing the HostResolver lifetime such that pending tasks are safely canceled or invalidated upon destruction.

Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33


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 destroy() method unregisters the network callback and immediately deletes the native object, but pending callbacks already queued on the ConnectivityThread are not purged, and there is no destruction flag to block them.

Impact

A local malicious app could potentially achieve arbitrary code execution in the highly privileged Android PAC processor service (UID 1000), though the report notes the steps are potential and were not verified with a live proof of concept.

What the attacker needed

Local malicious app; VpnService permission granted; ability to rapidly add/remove VPN IP addresses; timing to trigger race condition

The fix

The report suggests adding a destruction flag in Java to block callbacks after destroy(), and in C++ avoiding base::Unretained by using base::WeakPtr or managing the HostResolver lifetime so pending tasks are cancelled or invalidated.

How it was found

  1. A local attacker app with VpnService permission establishes a VPN and rapidly adds/removes IP addresses to flood the ConnectivityThread with callbacks.
  2. The system gracefully destroys the AwPacProcessor, freeing the 40-byte C++ object into a 48-byte PartitionAlloc bucket.
  3. A delayed callback fires, extracting the attacker-controlled VPN IP addresses and passing them through JNI.
  4. The JNI stub converts the Java List<String> to a C++ std::vector<std::string>; providing exactly two IP addresses allocates exactly 48 bytes, reclaiming the freed object.
  5. The first IP address is copied into the first std::string; under libc++ SSO, characters 8-15 overlap the host_resolver_ pointer field of the reclaimed object.
  6. The JNI stub casts the dangling long to an AwPacProcessor* and calls SetNetworkAndLinkAddresses, reading the forged host_resolver_ pointer and posting a task with base::Unretained.

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 later uses a pointer to that freed memory, which can let an attacker control what happens next. Here, a background network event can fire after the object is gone, and a malicious app on the same device could try to take advantage of that timing to run its own code in a powerful system service.

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.