Use after free in Audio (CVE-2026-17708)
A use-after-free was reported in the macOS/iOS audio input stream code, where teardown errors from CoreAudio are only logged in debug builds and ignored in release builds. If the audio callback thread stays alive after the stream object is deleted, the next callback would use freed memory inside the sandboxed audio service.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 56 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. 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 (UAF) vulnerability exists in AUAudioInputStream on macOS and iOS when the CoreAudio teardown sequence fails. In release builds, API teardown failures are not handled, causing the stream object to be deleted unconditionally while the real-time callback remains active. This can result in a Use-After-Free when the CoreAudio thread executes utilizing the freed stream context.
Affected files:
media/audio/apple/audio_low_latency_input.ccmedia/audio/apple/audio_low_latency_input.h
Estimated timestamp from git blame: 2011-10-05
Description
There is a potential Use-After-Free (UAF) vulnerability in AUAudioInputStream when the macOS CoreAudio driver fails to tear down or stop the active callback thread during stream closure.
AUAudioInputStream registers a raw this pointer with CoreAudio as the callback context (inputProcRefCon):
// media/audio/apple/audio_low_latency_input.cc:350-355 (non-VPIO path)
AURenderCallbackStruct callback;
callback.inputProc = &DataIsAvailable;
callback.inputProcRefCon = this;
result = AudioUnitSetProperty(
audio_unit_, kAudioOutputUnitProperty_SetInputCallback,
kAudioUnitScope_Global, AUElement::OUTPUT, &callback, sizeof(callback));
And similarly under the VoiceProcessing (VPIO) path (media/audio/apple/audio_low_latency_input.cc:490-506).
During stream shutdown, Stop() and CloseAudioUnit() attempt to halt and dispose of the audio unit. However, the OSStatus results of the teardown functions are only checked by DCHECK or OSSTATUS_DLOG_IF macros, which compile to no-ops in release builds:
// media/audio/apple/audio_low_latency_input.cc:763-764
OSStatus result = AudioOutputUnitStop(audio_unit_);
DCHECK_EQ(result, noErr);
And in CloseAudioUnit():
// media/audio/apple/audio_low_latency_input.cc:1236-1241
OSStatus result = AudioUnitUninitialize(audio_unit_);
OSSTATUS_DLOG_IF(ERROR, result != noErr, result) << "AudioUnitUninitialize() failed.";
result = AudioComponentInstanceDispose(audio_unit_);
OSSTATUS_DLOG_IF(ERROR, result != noErr, result) << "AudioComponentInstanceDispose() failed.";
Following these calls, Close() unconditionally proceeds to delete the stream:
// media/audio/apple/audio_low_latency_input.cc:796-800
CloseAudioUnit();
manager_->ReleaseInputStream(this);
// media/audio/audio_manager_base.cc:750
delete stream;
If the teardown calls fail (e.g. due to hardware unplug/transient state changes during destruction), CoreAudio might keep the real-time callback thread active. Since the raw this context pointer has not been invalidated or successfully cleared, the next callback iteration triggers a UAF on the deleted AUAudioInputStream context:
// media/audio/apple/audio_low_latency_input.cc:958-974
OSStatus AUAudioInputStream::DataIsAvailable(void* context, ...) {
AUAudioInputStream* self = reinterpret_cast<AUAudioInputStream*>(context);
return self->OnDataIsAvailable(flags, time_stamp, bus_number, number_of_frames);
}
As the raw callback context is held internally by macOS CoreAudio (outside of Chromium's heap controls), it is not protected by MiraclePtr (i.e. not a raw_ptr<>).
Potential Attack Steps
Note: Our tooling agent does not currently have the capability to execute code; the following is a potential sequence of events that could lead to triggering this vulnerability.
- A compromised renderer process with mic capture permissions requests the creation of an audio input stream using
blink.mojom.RendererAudioInputStreamFactory.CreateStream. - Once initialized, the attacker causes rapid, continuous AEC re-initializations by calling
AssociateInputAndOutputForAecrepeatedly, which drivesReinitializeVoiceProcessingAudioUnit()and forces frequent Stop-Dispose-Open cycles on the audio device. - During this high-frequency cycle, the attacker induces a hardware disconnection event or races with OS power-state transitions (e.g., system sleep or unplugging an audio device) to cause CoreAudio APIs to fail and return an error code.
- The renderer drops its audio Mojo pipes, which triggers stream shutdown. In the release build,
AudioOutputUnitStopandAudioComponentInstanceDisposefail silently, leaving the stream's callback thread active. - The
AUAudioInputStreaminstance is deleted, and the subsequent real-time callback invocation on the dangling pointer context triggers a Use-After-Free inside the sandboxed Audio service process.
Suggested Fix
We recommend implementing a thread-safe proxy mechanism similar to the sibling class CatapAudioInputStream (defined in media/audio/mac/catap_audio_input_stream.mm).
By routing callbacks through a separately allocated CatapIoProcProxy that holds a weak reference or a raw_ptr to the stream with proper thread synchronization (locking), you can safely disconnect the callback interface. If the synchronous teardown fails, the proxy object can be intentionally leaked (using ANNOTATE_LEAKING_OBJECT_PTR) to allow any remaining orphaned OS callbacks to access valid memory rather than causing a Use-After-Free.
Evaluated with Chrome root at commit: 9ebf4302210513a012c901d87a2668b3aadf8cc1
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.
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 handed to CoreAudio as the callback context, and teardown failures are only checked with debug-only macros, so the stream is deleted even if the callback thread was never stopped.
Impact
The report claims this could cause a use-after-free inside the sandboxed audio service process, but it is a potential issue and the tooling did not execute any code to confirm it.
What the attacker needed
Compromised renderer process; microphone capture permission; hardware disconnect or power-state race
The fix
The report suggests routing callbacks through a separately allocated proxy with thread synchronisation, and deliberately leaking the proxy if synchronous teardown fails so orphaned callbacks reach valid memory.
How it was found
- A compromised renderer with microphone permission asks for an audio input stream.
- The attacker repeatedly triggers AEC re-initialisation to force frequent stop, dispose and reopen cycles on the audio device.
- The attacker causes a hardware disconnect or races with OS power-state changes so the CoreAudio teardown calls return errors.
- The renderer drops its audio pipes, starting stream shutdown where the teardown failures are ignored.
- The stream object is deleted while the callback thread is still active, and the next callback uses the freed context.
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.
When a program finishes with an object, it frees the memory. Here the operating system's audio system keeps a pointer to that object and may still call it after it has been freed. Using memory that has already been freed is called a use-after-free, and it can crash the program or, in the worst case, let an attacker influence what happens next.
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.