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

Use after free in Media (CVE-2026-17804)

A use-after-free exists in the Speech Recognition utility process because a raw pointer to the recogniser object is passed as a callback handle to the SODA library, which may invoke the callback after the object is destroyed. An attacker who can reclaim the freed memory could potentially achieve remote code execution in the sandboxed utility process.

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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A potential Use-After-Free exists in the Speech Recognition utility process when the SODA library worker thread invokes a callback after the SpeechRecognitionRecognizerImpl object has been destroyed. The vulnerability arises from passing a raw 'this' pointer as a callback handle across a C ABI boundary.

Affected files:

  • chrome/services/speech/speech_recognition_recognizer_impl.cc
  • chrome/services/speech/soda/soda_client_impl.cc
  • chrome/services/speech/speech_recognition_recognizer_impl.h
  • chrome/services/speech/soda/soda_async_impl.h

Estimated timestamp from git blame: Unknown (Google3 checkout)

The SpeechRecognitionRecognizerImpl class manages speech recognition sessions in the utility process. It interfaces with the Speech On-Device API (SODA) library, providing a raw this pointer as a callback_handle and a static function OnSodaResponse to be called by the library upon recognition events.

Technical Analysis

In ResetSoda(), the raw pointer is assigned to the library configuration:

C++
// chrome/services/speech/speech_recognition_recognizer_impl.cc
config.callback = &OnSodaResponse;
config.callback_handle = this;

The SODA library invokes OnSodaResponse from internal worker threads. When a recognition session is ended (e.g., by a renderer disconnecting), the SpeechRecognitionRecognizerImpl destructor is called. This destructor initiates the SODA instance destruction via DeleteExtendedSodaAsync.

However, there is a potential race condition: if the library's worker threads do not strictly join during the "Async" deletion call, a callback may be invoked after the recognizer object has been freed. The static OnSodaResponse function synchronously dereferences the dangling callback_handle on the worker thread:

C++
// chrome/services/speech/speech_recognition_recognizer_impl.cc
void OnSodaResponse(const char* serialized_proto, int length, void* callback_handle) {
  // ...
  static_cast<SpeechRecognitionRecognizerImpl*>(callback_handle)
      ->recognition_event_callback() // Synchronous UAF on SODA thread
      .Run(std::move(speech_recognition_result));
}

Returning the recognition_event_callback_ member by value triggers a copy constructor for the base::RepeatingCallback. This involves an atomic increment on the internal BindState. An attacker who can reclaim the freed memory via heap spraying could control the BindState pointer, leading to arbitrary code execution when the .Run() method is invoked.

Existing protections like base::WeakPtr and base::BindPostTaskToCurrentDefault are insufficient because the synchronous dereference of the callback_handle occurs before the task is ever posted to the main thread.

Potential Impact

A compromised renderer could potentially exploit this Use-After-Free to achieve Remote Code Execution (RCE) in the sandboxed Speech Recognition utility process.

Suggested Potential Steps to Trigger

  1. From a compromised renderer, establish a connection to the SpeechRecognitionRecognizer interface.
  2. Start a speech recognition session and provide audio data to activate SODA worker threads.
  3. Quickly close the Mojo remote to trigger the deletion of the SpeechRecognitionRecognizerImpl object.
  4. Perform heap spraying in the utility process to attempt to reclaim the deallocated memory with attacker-controlled data before the SODA worker thread executes the callback.

Suggested Fix

Avoid passing raw pointers to external libraries that use independent threading models unless a synchronous, thread-joining shutdown is guaranteed. A robust fix would be to use a thread-safe registry or relay object. The callback_handle should point to a reference-counted relay that can be invalidated by the SpeechRecognitionRecognizerImpl during its destruction, ensuring that any subsequent callbacks from the SODA library can safely detect that the recognizer no longer exists.

Evaluated with Chrome root at commit: 29093e11cf509e3593f6229e4b1b075cca356049


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

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 raw 'this' pointer is passed as a callback handle across a C ABI boundary without a guarantee that the library's worker threads have joined before the object is destroyed.

Impact

A compromised renderer could potentially exploit this use-after-free to achieve remote code execution in the sandboxed Speech Recognition utility process.

What the attacker needed

Compromised renderer; ability to heap spray utility process

The fix

The callback handle should point to a reference-counted relay that the recogniser can invalidate during destruction, so later callbacks can safely detect that the recogniser no longer exists.

How it was found

  1. From a compromised renderer, connect to the SpeechRecognitionRecognizer interface.
  2. Start a speech recognition session and provide audio data to activate SODA worker threads.
  3. Quickly close the Mojo remote to trigger deletion of the recogniser object.
  4. Heap spray in the utility process to try to reclaim the freed memory before the SODA worker thread runs the callback.

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 keeps using memory after it has been freed. Here, a speech recognition component hands a pointer to itself to a library, and if that library calls back after the component is gone, the program reads or writes memory it no longer owns. An attacker who can control what fills that freed memory might then 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.