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

Use after free in Serial (CVE-2026-11012)

A data race on a hash map in the Android serial device enumerator can cause heap corruption and a use-after-free in the browser process. An attacker could potentially exploit this to escape the sandbox and run code with the browser's privileges.

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.

Overview: SerialDeviceEnumeratorAndroid mutates an absl::flat_hash_map concurrently from multiple background threads without synchronization. This data race can lead to heap corruption and a potential use-after-free in the highly privileged browser process. Triggering this requires the disabled-by-default Web Serial on Android feature and explicit user permission.

Affected files:

  • services/device/serial/serial_device_enumerator_android.cc
  • services/device/serial/serial_device_enumerator_android.h
  • services/device/serial/serial_io_handler_android.cc
  • services/device/serial/android/java/src/org/chromium/device/serial/ChromeSerialManager.java

Estimated timestamp from git blame: 2026-02-02

Description

There is a potential data race and memory corruption vulnerability in SerialDeviceEnumeratorAndroid due to unsynchronized access to the callbacks_ member variable, which is an absl::flat_hash_map<std::string, std::unique_ptr<Callbacks>>.

This map is mutated from at least two distinct, unsynchronized thread contexts:

  1. Chrome ThreadPool (OpenPath): When a Web Serial port is opened, SerialIoHandlerAndroid::OpenImpl() posts a task using base::ThreadPool::PostTask({base::MayBlock(), ...}) to execute SerialDeviceEnumeratorAndroid::OpenPath(). This method performs find(), emplace(), and potentially extract() on the callbacks_ map. Because it uses an unsequenced task runner, concurrent port.open() requests can execute simultaneously on multiple worker threads.
  2. Android AsyncTask Thread (OpenPathCallbackViaJni / ErrorCallbackViaJni): When the Android OS finishes opening the port, Java invokes the completion handlers via JNI. The Java code uses AsyncTask.THREAD_POOL_EXECUTOR, meaning these JNI calls execute on an Android background thread. The C++ JNI handlers (OpenPathCallbackViaJni and ErrorCallbackViaJni) directly call callbacks_.extract() without posting back to a safe sequence.

absl::flat_hash_map is not thread-safe. Concurrent mutations—such as a ThreadPool worker performing an emplace() (which may trigger a rehash and free the backing array) while an Android worker performs an extract()—will severely corrupt the map's internal state. This leads to Heap Use-After-Free (UAF) and memory corruption.

Because the Device Service on Android runs directly in the browser process, this heap corruption provides a potential path to a sandbox escape and Remote Code Execution (RCE) with the privileges of the browser app.

Note: The kWebSerialWiredDevicesAndroid feature is currently disabled by default and requires a physical USB device and explicit user permission to trigger.

Potential Steps to Reproduce

Note: Our tooling agent cannot run live code, so these are suggested steps to trigger the race condition.

  1. Enable the chrome://flags/#enable-web-serial-wired-devices-android feature flag.
  2. Connect a USB-serial device to the Android device.
  3. Navigate to a malicious website that requests Web Serial permissions (navigator.serial.requestPort()).
  4. The user approves the chooser dialog.
  5. The malicious JavaScript acquires multiple references to the SerialPort object (e.g., using same-origin Web Workers or iframes).
  6. The script concurrently calls port.open({ baudRate: 9600 }) across the workers, or rapidly initiates and aborts port openings.
  7. This causes simultaneous emplace() and extract() calls on the absl::flat_hash_map from Chrome's ThreadPool and Android's AsyncTask threads, triggering a crash or UAF.

Suggested Fix

Access to the callbacks_ map must be synchronized.

  1. Use a SequencedTaskRunner: Ensure all accesses to callbacks_ happen on SerialDeviceEnumeratorAndroid's internal task_runner_.
    • Modify SerialIoHandlerAndroid::OpenImpl to post to the enumerator's specific task_runner_ instead of a generic ThreadPool::PostTask.
    • Modify the JNI callbacks (OpenPathCallbackViaJni and ErrorCallbackViaJni) so they do not access callbacks_ directly. Instead, they should post a task to task_runner_ to handle the extraction and callback execution, similar to how AddPortViaJni handles non-initial enumerations.
  2. Alternatively, use a Mutex: Guard callbacks_ with a base::Lock, though sequence bounding is generally preferred in Chromium over manual locking.

Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0


Results from 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 callbacks_ hash map is accessed and modified from two different threads without any synchronisation.

Impact

Heap corruption in the browser process could allow a sandbox escape and remote code execution, but the feature is disabled by default and requires a physical USB device and explicit user permission.

What the attacker needed

Web Serial on Android feature enabled; Physical USB-serial device connected; Victim visits malicious site; User grants serial permission

The fix

All accesses to the callbacks_ map should be moved onto the enumerator's own sequenced task runner, or alternatively guarded by a mutex.

How it was found

  1. Enable the Web Serial on Android feature flag.
  2. Connect a USB-serial device to the Android device.
  3. Visit a malicious site that requests Web Serial permission.
  4. Approve the permission dialog.
  5. Obtain multiple references to the serial port object from workers or iframes.
  6. Call port.open concurrently from those contexts to trigger the race.

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 hash map is a data structure that stores key-value pairs. If two threads change it at the same time without coordination, its internal memory can become corrupted. Here, that corruption happens inside the browser's main process, which could 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.