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

Use after free in WebAudio (CVE-2026-9952)

A suspected race between the main-thread garbage collector and the audio rendering thread could free an audio buffer while the audio thread is still copying frames into it, producing a use-after-free write. The report claims an attacker could shape the written float data and, by winning the race, corrupt a reallocated object, potentially leading to code execution in the renderer.

Google Chrome

Originally disclosed on Chrome VRP

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

Overview: A potential cross-thread race condition between the main thread garbage collector and the audio rendering thread can cause a heap use-after-free write in AudioPushFifo. A pre-finalizer may destroy the underlying audio buffer while the background audio thread is actively writing to it.

Affected files:

  • media/base/audio_push_fifo.cc
  • third_party/blink/renderer/platform/mediastream/media_stream_source.cc
  • third_party/blink/renderer/platform/mediastream/webaudio_media_stream_source.cc
  • third_party/blink/renderer/platform/mediastream/media_stream_audio_source.cc
  • third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_handler.cc

Estimated timestamp from git blame: 2026-01-23

Summary

A potential heap use-after-free (UAF) vulnerability exists in the WebAudio to MediaStream pipeline. A lack of proper synchronization during garbage collection (GC) allows the MediaStreamSource pre-finalizer to destroy a WebAudioMediaStreamSource and its associated AudioPushFifo buffer while the audio rendering thread is concurrently writing audio frames into that buffer. This results in an out-of-bounds/Use-After-Free write of attacker-controlled audio float data into freed heap memory.

Technical Details

  1. When a MediaStreamAudioDestinationNode is created, it allocates a WebAudioMediaStreamSource and then wraps it in a garbage-collected MediaStreamSource.
  2. Due to Blink's Oilpan LIFO (reverse-registration) execution order for pre-finalizers, MediaStreamSource::Dispose will execute before MediaStreamAudioDestinationNode::Dispose during a GC sweep.
  3. The audio thread processes data via MediaStreamAudioDestinationHandler::Process, which acquires consumer_lock_ and forwards audio to WebAudioMediaStreamSource::ConsumeAudio.
  4. Inside ConsumeAudio, the audio data is pushed into an AudioPushFifo. The audio thread extracts stack-local base::span references pointing directly to the AudioBus's underlying memory (base::AlignedHeapArray<float>) and begins a copy loop (CopyPartialFramesTo).
  5. If the AudioContextAsyncStateTransitions feature is enabled, the AudioContext may still be in the kSuspended state immediately after creation, causing MediaStreamAudioDestinationNode::HasPendingActivity() to return false. This makes the node and its MediaStreamSource unexpectedly eligible for garbage collection, even though the background render thread is actively processing the graph.
  6. The GC executes MediaStreamSource::Dispose() on the main thread, which directly deletes the WebAudioMediaStreamSource (and consequently frees the AudioBus's float array) without acquiring consumer_lock_.
  7. The audio thread, completely unaware of the destruction, continues its copy loop, writing attacker-controlled float values into the now-freed AlignedHeapArray memory.

MiraclePtr (BackupRefPtr) does not protect against this vulnerability because the audio thread accesses the buffer memory via raw base::span slices that were retrieved before the object's destruction, bypassing the BRP quarantine mechanisms for the AudioBus object itself.

Suggested Exploit Steps

(Note: These are potential steps to trigger the vulnerability, as our automated tooling cannot run code to verify a proof-of-concept.)

  1. Create an AudioContext with AudioContextAsyncStateTransitions enabled.
  2. Create an AudioBufferSourceNode populated with a crafted AudioBuffer containing malicious pointers and forged vtables encoded as float values.
  3. Create a MediaStreamAudioDestinationNode and connect the source node to it.
  4. Call start() on the source node to initiate audio processing.
  5. Immediately remove all Javascript references to the destination node and trigger garbage collection before the AudioContext fully transitions to the kRunning state.
  6. The GC will free the AudioBus memory while the audio thread is concurrently copying the crafted float payload into it. By allocating a victim object into the freed block during the race window, the UAF write will corrupt the victim object, potentially leading to arbitrary Remote Code Execution (RCE) in the renderer.

Suggested Fix

There are multiple potential ways to address this issue:

  • Prevent Premature GC: Modify MediaStreamAudioDestinationNode::HasPendingActivity() to return true whenever an async state transition is pending. This prevents the nodes from being collected while the audio thread might be starting up.
  • Ensure Safe Destruction Order: The audio thread relies on MediaStreamAudioDestinationNode::Dispose() to acquire consumer_lock_ and nullify destination_consumer_. Ensure this cleanup runs before the underlying MediaStreamSource destroys the WebAudioMediaStreamSource.
  • Use Smart Pointers/Thread-Safe Destruction: Manage the lifecycle of WebAudioMediaStreamSource across threads using scoped_refptr instead of relying entirely on the GC pre-finalizer order.

Evaluated with Chrome root at commit: 2b349e31cb87959d6a548625986c65e0a2d2e380


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 garbage collector's pre-finalizer destroys the audio source without taking the consumer lock, so the audio thread keeps writing through stale spans into freed memory.

Impact

If the race is won, the write could corrupt a reallocated object and potentially lead to arbitrary code execution in the renderer, though the report notes the steps are unverified.

What the attacker needed

Feature flag enabled; attacker-supplied audio buffer; win a timing race

The fix

The report suggests making the node report pending activity while a state transition is outstanding, ordering cleanup so the lock is taken before the source is destroyed, or managing the source's lifetime with reference counting across threads.

How it was found

  1. Create an audio context with the async state transition feature enabled.
  2. Create a buffer source node filled with a crafted audio buffer.
  3. Create a media stream destination node and connect the source to it.
  4. Start the source node so audio processing begins.
  5. Drop all references to the destination node and force garbage collection before the context reaches the running state.
  6. The freed buffer is written to during the race, corrupting any object allocated into that space.

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 a chunk of memory but keeps using it, so new data placed there can be overwritten or misread. Here the browser's cleanup code is said to free an audio buffer on one thread while a background audio thread is still writing sound samples into it. The report is unverified and comes from automated tooling, so it may be a false positive.

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.