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

Use after free in Codecs (CVE-2026-6362)

A use-after-free read of VP9 alpha plane data occurs when a crafted WebM triggers VP9's show_existing_frame mechanism while alternating the alpha side-stream's bit depth. An attacker could cause a renderer crash by reading freed memory during YUV texture upload.

c6eed09fc8b174b0f3eebedcceb1e792 Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 9 days

VP9 alpha plane use-after-free via show_existing_frame reuse of FrameBufferPool storage

Summary

A use-after-free read of VP9 alpha plane data occurs when a crafted WebM triggers VP9's show_existing_frame mechanism while alternating the alpha side-stream's bit depth. The FrameBufferPool stores alpha data keyed by fb_priv, and show_existing_frame causes consecutive output frames to share the same fb_priv. When a subsequent frame's alpha plane requires a larger allocation (due to a bit-depth change from 8-bit to 10-bit), the pool frees the old alpha buffer while a previously emitted VideoFrame still holds a dangling base::span into it. The compositor thread then reads 92160 bytes from freed memory during YUV texture upload. The vulnerability is not mitigated by MiraclePtr. It affects all desktop platforms (Linux, macOS, Windows) and requires no special GPU or hardware.

Bisect

Introducing Commit: f12d64fb2c759a2e62653b08b663a79299f63d4c

This commit introduced VP9 alpha channel support by adding per-fb_priv alpha storage to the decoder's memory pool. The design assumed that each fb_priv would only be associated with one live output frame at a time, which is violated by show_existing_frame.

Root Cause

Chrome's VP9 decoder uses libvpx's external frame buffer API. Each decoded frame carries an opaque fb_priv pointer identifying its backing FrameBuffer in the FrameBufferPool. When a VP9 bitstream signals show_existing_frame, libvpx does not allocate a new buffer; it increments the reference count on an existing reference frame buffer and returns the same fb_priv:

C
// third_party/libvpx/source/libvpx/vp9/decoder/vp9_decodeframe.c
cm->show_existing_frame = vpx_rb_read_bit(rb);
if (cm->show_existing_frame) {
  const int frame_to_show = cm->ref_frame_map[vpx_rb_read_literal(rb, 3)];
  ref_cnt_fb(frame_bufs, &cm->new_fb_idx, frame_to_show);
}

Chrome handles VP9 alpha as a separate side-stream whose decoded pixels are stored per fb_priv in the pool's alpha_data field. In VpxVideoDecoder::CopyVpxImageToVideoFrame, the alpha plane size is computed from the alpha image's stride and height, then passed to AllocateAlphaPlaneForFrameBuffer using the main image's fb_priv as the key:

C++
// media/filters/vpx_video_decoder.cc:580-598
size_t alpha_plane_size =
    vpx_image_alpha->stride[VPX_PLANE_Y] * vpx_image_alpha->d_h;
auto alpha_plane = memory_pool_->AllocateAlphaPlaneForFrameBuffer(
    alpha_plane_size, vpx_image->fb_priv);
libyuv::CopyPlane(vpx_image_alpha->planes[VPX_PLANE_Y],
                  vpx_image_alpha->stride[VPX_PLANE_Y],
                  alpha_plane.data(),
                  vpx_image_alpha->stride[VPX_PLANE_Y],
                  vpx_image_alpha->d_w, vpx_image_alpha->d_h);
*video_frame = VideoFrame::WrapExternalYuvaData(
    codec_format, coded_size, gfx::Rect(visible_size), natural_size,
    ..., alpha_plane, kNoTimestamp);

The resulting VideoFrame stores the alpha plane pointer as a base::span<const uint8_t> in its data_ array, which is a raw span with no reference-counting or lifetime tracking on the underlying buffer.

When the pool sees a request for a larger alpha allocation on the same fb_priv, it frees the old buffer and allocates a new one:

C++
// media/base/frame_buffer_pool.cc:158-174
base::span<uint8_t> FrameBufferPool::AllocateAlphaPlaneForFrameBuffer(
    size_t min_size, void* fb_priv) {
  base::AutoLock lock(lock_);
  auto* frame_buffer = static_cast<FrameBuffer*>(fb_priv);
  if (frame_buffer->alpha_data.size() < min_size) {
    frame_buffer->alpha_data = {};   // frees the old buffer
    frame_buffer->alpha_data = AllocateMemory(min_size, ...);
  }
  return frame_buffer->alpha_data;
}

The held_by_frame counter on the FrameBuffer only protects the FrameBuffer struct itself from deletion; it does not prevent alpha_data from being freed and reallocated. At the point of reallocation, held_by_frame is 1 (the previous VideoFrame is still alive in the rendering pipeline), yet the old alpha buffer is freed unconditionally.

The PoC constructs a WebM with a VP9 keyframe paired with 8-bit alpha (stride 384, alpha size 92160 bytes), followed by show_existing_frame entries paired with 10-bit alpha (stride 768, alpha size 184320 bytes). Because show_existing_frame reuses the same fb_priv, the second decode call hits the alpha_data.size() < min_size path and frees the 92160-byte buffer. The first VideoFrame, still queued for compositing, holds a dangling span into the freed region.

The freed alpha buffer is then read on the VideoFrameCompositor thread when the compositor uploads the stale frame's YUV planes to a GPU texture. In WriteYUVPixelsForAllPlanesToTexture, each plane's data is accessed through a raw const uint8_t* returned by video_frame->data(plane):

C++
// media/renderers/video_resource_updater.cc:1075-1078
const uint8_t* pixels;
if (!needs_conversion) {
    pixels = video_frame->data(frame_planes[plane_index]);
    ...
}

This pointer is not wrapped in raw_ptr<T>, so MiraclePtr/BackupRefPtr does not observe the access. Furthermore, at the time the alpha buffer is freed, no raw_ptr references it (the VideoFrame stores it in a base::span), so PartitionAlloc's BRP quarantine mechanism does not engage and the memory is returned to the allocator immediately. ASAN confirms MiraclePtr Status: NOT PROTECTED.

Reproduce

Tested at commit 5e60c832cb8d7cddd0bc4f84d3c8864c80649afb on Linux x86_64.

Build with is_asan = true and is_debug = false. Serve the attached poc.html and poc.webm from the same directory over HTTP. Launch:

ASAN_OPTIONS=detect_odr_violation=0 ~/chromium/src/out/asan-release/chrome \
  --no-sandbox \
  --user-data-dir=/tmp/poc-$(date +%s) \
  http://localhost:8899/poc.html

Click the page to start playback if autoplay is blocked. The renderer crashes within seconds. ASAN reports:

==2816922==ERROR: AddressSanitizer: heap-use-after-free on address 0x7eea6a240800
READ of size 92160 at 0x7eea6a240800 thread T12 (VideoFrameCompo)
    #0 __asan_memcpy
    #1 gpu::raster::RasterImplementation::WritePixelsYUV gpu/command_buffer/client/raster_implementation.cc:1317
    #2 media::VideoResourceUpdater::WriteYUVPixelsForAllPlanesToTexture media/renderers/video_resource_updater.cc:1166

freed by thread T11 (Media):
    #0 free
    #1 media::FrameBufferPool::AllocateAlphaPlaneForFrameBuffer
    #2 media::VpxVideoDecoder::CopyVpxImageToVideoFrame media/filters/vpx_video_decoder.cc:589

previously allocated by thread T11 (Media):
    #0 calloc
    #1 base::UncheckedCalloc
    #2 media::AllocateMemory media/base/frame_buffer_pool.cc:78
    #3 media::FrameBufferPool::AllocateAlphaPlaneForFrameBuffer media/base/frame_buffer_pool.cc:181

MiraclePtr Status: NOT PROTECTED
No raw_ptr<T> access to this region was detected prior to this crash.
This crash is still exploitable with MiraclePtr.

The complete ASAN log is in the attached asan.log.

Credit

Please use c6eed09fc8b174b0f3eebedcceb1e792 as the credit for this vulnerability. Thank you.

The original report as published on the Chromium issue tracker, by c6eed09fc8b174b0f3eebedcceb1e792. 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

The FrameBufferPool frees and reallocates alpha_data for a given fb_priv without checking whether a previously emitted VideoFrame still holds a span into that buffer, because show_existing_frame causes multiple output frames to share the same fb_priv.

Impact

The vulnerability causes a renderer crash due to a use-after-free read; the text does not claim code execution or other impact.

What the attacker needed

Victim opens a crafted WebM; Chrome with VP9 alpha support

How it was found

  1. Build Chromium with ASAN and debug disabled.
  2. Serve the provided HTML and WebM files over HTTP.
  3. Launch Chrome with the given flags and navigate to the page.
  4. Click the page to start playback if autoplay is blocked.
  5. Observe the renderer crash with ASAN reporting heap-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.

When a video is decoded, the decoder stores extra transparency data (alpha) in a memory buffer. A bug lets a second frame reuse the same buffer identifier but request a larger size, so the old buffer is freed while the first frame still points to it. The graphics thread then reads the freed memory, causing a crash.

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

View all

52 more disclosed reports, best first.

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.