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

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

Critical View original
  • 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.cc
  • chromecast/media/common/audio_decoder_wrapper.cc
  • chromecast/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

  1. Premature Reference Release: When a buffer is pushed, MediaPipelineBufferExtension::PushBuffer delegates downstream, eventually invoking the vendor's asynchronous PushBuffer which returns kBufferPending. However, if the buffer extension's queue is not full, it translates this status and returns kBufferSuccess to the upstream AvPipelineImpl (chromecast/media/cma/backend/proxy/media_pipeline_buffer_extension.cc):

    C++
    return IsBufferFull() ? BufferStatus::kBufferPending
                          : BufferStatus::kBufferSuccess;
    

    As a result, AvPipelineImpl immediately nulls its pushed_buffer_ reference (chromecast/media/cma/pipeline/av_pipeline_impl.cc), assuming the buffer push completed successfully.

  2. Sole Ownership: At this stage, the only scoped_refptr holding the DecoderBufferBase alive is ActiveAudioDecoderWrapper::pushed_buffer_ (chromecast/media/common/audio_decoder_wrapper.cc). Meanwhile, the vendor's backend decoder holds a raw, unprotected pointer (CastDecoderBuffer*) to the buffer.

  3. 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 the DecoderBufferBase. Crucially, this happens before the active vendor-implemented backend is stopped or destroyed.

  4. Use-After-Free: Immediately after, MediaPipelineBackendWrapper::Revoke() queries backend_->GetCurrentPts(). During this call, or during subsequent destruction of the vendor backend/asynchronous decode threads, the vendor backend may dereference the dangling CastDecoderBuffer* pointer. Since CastDecoderBuffer is 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.

  1. Navigate to a page on a Cast Core device that initiates media playback on a multiroom/cast-renderer-enabled stream (Element A).
  2. Feed encoded audio such that the vendor backend returns kBufferPending, but MediaPipelineBufferExtension returns kBufferSuccess, leaving ActiveAudioDecoderWrapper as the sole owner of the buffer.
  3. Initiate playback of a second video element (Element B) to trigger video decoder resource reallocation.
  4. MediaPipelineBackendManager invokes Revoke() on Element A, destroying ActiveAudioDecoderWrapper and freeing the buffer.
  5. 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.

  1. Maintain Buffer Lifetime: Ensure that ActiveAudioDecoderWrapper does not destroy or release pushed_buffer_ during Revoke() until the underlying vendor backend's AudioDecoder has been stopped, flushed, or fully destroyed.
  2. Correct Status Propagation: Avoid translating kBufferPending to kBufferSuccess upstream 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.

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 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

  1. Navigate to a page on a Cast Core device that initiates media playback on a multiroom/cast-renderer-enabled stream.
  2. Feed encoded audio such that the vendor backend returns kBufferPending, but MediaPipelineBufferExtension returns kBufferSuccess.
  3. Initiate playback of a second video element to trigger video decoder resource reallocation.
  4. MediaPipelineBackendManager invokes Revoke() on the first element, destroying ActiveAudioDecoderWrapper and freeing the buffer.
  5. 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.

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.