Use after free in Chromecast (CVE-2026-106382)
A use-after-free occurs in Chromecast media playback when a buffer extension incorrectly reports success for a pending buffer, causing the pipeline to release its reference. When the audio decoder wrapper is later revoked, the buffer is freed while the vendor backend still holds a dangling pointer, potentially allowing code execution.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 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: Under ENABLE_CHROMIUM_RUNTIME_CAST_RENDERER builds, MediaPipelineBufferExtension can prematurely return kBufferSuccess to the pipeline for a pending buffer. This causes the upstream pipeline to drop its reference, leaving ActiveAudioDecoderWrapper as the sole owner. When a subsequent revocation event destroys ActiveAudioDecoderWrapper, the buffer is freed while the vendor backend still holds a dangling raw pointer to it.
Affected files:
chromecast/media/cma/backend/proxy/media_pipeline_buffer_extension.ccchromecast/media/common/audio_decoder_wrapper.ccchromecast/media/common/media_pipeline_backend_wrapper.cc
Estimated timestamp from git blame: 2021-03-23
Description
A potential Use-After-Free (UAF) vulnerability exists in the Chromecast CMA (Cast Media Arena) backend proxy code under ENABLE_CHROMIUM_RUNTIME_CAST_RENDERER builds. This build configuration inserts a CmaBackendProxy between MediaPipelineImpl and the inner MediaPipelineBackendWrapper (chromecast/media/cma/backend/cma_backend_factory_impl.cc).
Root Cause Analysis
-
Premature Reference Release: When a buffer is pushed,
MediaPipelineBufferExtension::PushBufferdelegates downstream, eventually invoking the vendor's asynchronousPushBufferwhich returnskBufferPending. However, if the buffer extension's queue is not full, it translates this status and returnskBufferSuccessto the upstreamAvPipelineImpl(chromecast/media/cma/backend/proxy/media_pipeline_buffer_extension.cc):C++ return IsBufferFull() ? BufferStatus::kBufferPending : BufferStatus::kBufferSuccess;As a result,
AvPipelineImplimmediately nulls itspushed_buffer_reference (chromecast/media/cma/pipeline/av_pipeline_impl.cc), assuming the buffer push completed successfully. -
Sole Ownership: At this stage, the only
scoped_refptrholding theDecoderBufferBasealive isActiveAudioDecoderWrapper::pushed_buffer_(chromecast/media/common/audio_decoder_wrapper.cc). Meanwhile, the vendor's backend decoder holds a raw, unprotected pointer (CastDecoderBuffer*) to the buffer. -
Premature Destruction during Revocation: When another stream requires resources,
MediaPipelineBackendWrapper::Revoke()is called to revoke the active pipeline. This executes:C++ if (audio_decoder_) audio_decoder_->Revoke();This reassignment destroys
ActiveAudioDecoderWrapper, which immediately deallocates theDecoderBufferBase. Crucially, this happens before the active vendor-implemented backend is stopped or destroyed. -
Use-After-Free: Immediately after,
MediaPipelineBackendWrapper::Revoke()queriesbackend_->GetCurrentPts(). During this call, or during subsequent destruction of the vendor backend/asynchronous decode threads, the vendor backend may dereference the danglingCastDecoderBuffer*pointer. SinceCastDecoderBufferis an abstract class with pure virtual methods, any method call leads to a virtual method call on a freed object, enabling potential flow hijack.
Potential Steps to Reproduce
Note: These are potential steps modeled from code analysis, as our tooling environment does not currently have the capability to execute code or run a live proof of concept.
- Navigate to a page on a Cast Core device that initiates media playback on a multiroom/cast-renderer-enabled stream (Element A).
- Feed encoded audio such that the vendor backend returns
kBufferPending, butMediaPipelineBufferExtensionreturnskBufferSuccess, leavingActiveAudioDecoderWrapperas the sole owner of the buffer. - Initiate playback of a second video element (Element B) to trigger video decoder resource reallocation.
MediaPipelineBackendManagerinvokesRevoke()on Element A, destroyingActiveAudioDecoderWrapperand freeing the buffer.- The vendor backend accesses the freed buffer during
GetCurrentPts()or destructor teardown, triggering a Use-After-Free.
Suggested Fix
To remediate this issue, the lifetime of the DecoderBufferBase must be guaranteed to span the duration expected by the vendor backend contract.
- Maintain Buffer Lifetime: Ensure that
ActiveAudioDecoderWrapperdoes not destroy or releasepushed_buffer_duringRevoke()until the underlying vendor backend'sAudioDecoderhas been stopped, flushed, or fully destroyed. - Correct Status Propagation: Avoid translating
kBufferPendingtokBufferSuccessupstream if doing so causes the pipeline to release its reference before the vendor backend has completed processing the buffer.
Evaluated with Chrome root at commit: b5b015ea5f690560237d1f0cff1405844cd12b8d
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 buffer extension translates a pending buffer status to success, causing the upstream pipeline to drop its reference while the vendor backend still holds a raw pointer, and the wrapper is destroyed before the backend is stopped.
Impact
The vendor backend may dereference the dangling pointer, leading to a virtual method call on a freed object and enabling potential flow hijack.
What the attacker needed
Cast Core device with ENABLE_CHROMIUM_RUNTIME_CAST_RENDERER; Ability to initiate media playback; Multiroom/cast-renderer-enabled stream
The fix
The fix should ensure the buffer lifetime spans the vendor backend contract and avoid translating kBufferPending to kBufferSuccess upstream.
How it was found
- Navigate to a page on a Cast Core device that initiates media playback on a multiroom/cast-renderer-enabled stream.
- Feed encoded audio such that the vendor backend returns kBufferPending, but MediaPipelineBufferExtension returns kBufferSuccess.
- Initiate playback of a second video element to trigger video decoder resource reallocation.
- MediaPipelineBackendManager invokes Revoke() on the first element, destroying ActiveAudioDecoderWrapper and freeing the buffer.
- The vendor backend accesses the freed buffer during GetCurrentPts() or destructor teardown, triggering a Use-After-Free.
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 is a bug where a program frees memory but keeps using it, like deleting a file and then trying to open it. Here, a media buffer is freed too early while another part of the code still points to it. An attacker who can trigger this could potentially run their own code on the device.
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.