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

Heap buffer overflow in WebRTC (CVE-2026-4463)

A heap buffer overflow write occurs in libaom's AV1 encoder when encoding spatial SVC video via WebRTC, because the chroma_check function uses the LAST_FRAME's scale factors for GOLDEN_FRAME and ALTREF_FRAME, which have different resolutions. An attacker can trigger this by establishing a WebRTC peer connection with AV1 and the L2T1 scalability mode, causing a write past the end of the allocated frame buffer.

c6eed09fc8b174b0f3eebedcceb1e792 Follow

Originally disclosed on Chrome VRP

  • Fix shipped in 9 days

Heap buffer overflow write in libaom AV1 SVC encoding via WebRTC

Summary

A heap buffer overflow write exists in libaom's AV1 encoder when encoding video with spatial Scalable Video Coding (SVC) through WebRTC. The chroma_check function in var_based_part.c uses the LAST_FRAME reference's scale factors when computing buffer offsets for GOLDEN_FRAME and ALTREF_FRAME, which have different resolutions in spatial SVC configurations. This causes setup_pred_plane to calculate an out-of-bounds buffer pointer, and subsequent frame copy operations write past the end of the allocated YV12 frame buffer. A web page can trigger this by establishing a WebRTC peer connection with AV1 and the L2T1 scalability mode. The vulnerability affects all platforms where WebRTC AV1 SVC encoding is supported (Windows, Linux, macOS, ChromeOS, Android).

Bisect

Introducing Commit (GOLDEN path): c6a503f

Extended to ALTREF path: 555b3aa

Both commits are in the upstream aom.git repository. The original setup_pred_plane with LAST_FRAME's scale factors was introduced in commit 309d0af (July 27, 2022) for the LAST_FRAME path, where using LAST's scale factors is correct. When the GOLDEN and ALTREF paths were added in the subsequent commits, they reused the same sf variable without obtaining the appropriate scale factors for those reference frames.

Root Cause

The chroma_check function in var_based_part.c computes UV chroma SAD values for three reference frames (LAST, GOLDEN, ALTREF) to determine color sensitivity. It retrieves the scale factors once, for LAST_FRAME only:

C
// av1/encoder/var_based_part.c:1026-1029
// https://aomedia.googlesource.com/aom/+/39606bf4bae/av1/encoder/var_based_part.c#1026
const YV12_BUFFER_CONFIG *yv12_g = get_ref_frame_yv12_buf(cm, GOLDEN_FRAME);
const YV12_BUFFER_CONFIG *yv12_alt = get_ref_frame_yv12_buf(cm, ALTREF_FRAME);
const struct scale_factors *const sf =
    get_ref_scale_factors_const(cm, LAST_FRAME);

This sf is then passed to setup_pred_plane for all three reference frames. For LAST_FRAME, this is correct. For GOLDEN_FRAME and ALTREF_FRAME, it is wrong:

C
// av1/encoder/var_based_part.c:1062-1069
// https://aomedia.googlesource.com/aom/+/39606bf4bae/av1/encoder/var_based_part.c#1062
if (y_sad_g != UINT_MAX) {
    uint8_t *src = (plane == 1) ? yv12_g->u_buffer : yv12_g->v_buffer;
    setup_pred_plane(&dst, xd->mi[0]->bsize, src, yv12_g->uv_crop_width,
                     yv12_g->uv_crop_height, yv12_g->uv_stride, xd->mi_row,
                     xd->mi_col, sf, xd->plane[plane].subsampling_x,
                     xd->plane[plane].subsampling_y);
    uv_sad_g = cpi->ppi->fn_ptr[bs].sdf(p->src.buf, p->src.stride,
                                         dst.buf, dst.stride);
}

The setup_pred_plane function computes the buffer pointer as dst->buf = src + scaled_buffer_offset(x, y, stride, scale), where x and y are derived from the current macroblock's mi_row and mi_col:

C
// av1/common/reconinter.h:386-404
// https://aomedia.googlesource.com/aom/+/39606bf4bae/av1/common/reconinter.h#386
static inline void setup_pred_plane(struct buf_2d *dst, BLOCK_SIZE bsize,
                                    uint8_t *src, int width, int height,
                                    int stride, int mi_row, int mi_col,
                                    const struct scale_factors *scale,
                                    int subsampling_x, int subsampling_y) {
    const int x = (MI_SIZE * mi_col) >> subsampling_x;
    const int y = (MI_SIZE * mi_row) >> subsampling_y;
    dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
}

In AV1 spatial SVC, the enhancement layer (e.g., 1280x720) references a lower-resolution base layer (e.g., 640x360) as its GOLDEN frame. LAST_FRAME, being from the same spatial layer, has identity scale factors (no scaling). When these identity scale factors are applied to mi_row/mi_col coordinates from the 1280x720 layer while indexing into the 640x360 GOLDEN buffer, the resulting offset exceeds the smaller buffer's allocation. For a 1280x720 frame with 4:2:0 chroma subsampling, the UV plane coordinates can reach up to y=358, but the GOLDEN frame's UV buffer at 640x360 only accommodates rows up to y=179, producing an overflow of approximately 114 rows worth of data.

The ASAN report shows the overflow manifests as a write of 640 bytes immediately past the end of a 688,935-byte allocation in aom_yv12_copy_v_c, which copies the V chroma plane row by row using memcpy. The overflow occurs because the source or destination frame buffer was allocated for the smaller spatial layer dimensions, while the copy loop iterates over the larger layer's height.

Reproduce

Configure out/asan-release/args.gn:

is_asan = true
is_debug = false
dcheck_always_on = false
target_cpu = "x64"
is_component_build = true

Then build and run:

autoninja -C out/asan-release chrome
ASAN_OPTIONS=detect_odr_violation=0 out/asan-release/chrome --no-sandbox poc.html

The PoC opens a WebRTC peer connection with AV1 SVC (L2T1 scalability mode) encoding a 1280x720 canvas stream. The heap-buffer-overflow fires within seconds of encoding.

The ASAN report:

=================================================================
==43000==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x1409738e9b27 at pc 0x7ff8de4eb48c bp 0x00e97d7fc8e0 sp 0x00e97d7fc928
WRITE of size 640 at 0x1409738e9b27 thread T5
    #0 0x7ff8de4eb48b  (clang_rt.asan_dynamic-x86_64.dll+0x18004b48b)
    #1 0x7ff8b03c7b9a in aom_yv12_copy_v_c yv12extend.c:313:5
    #2 0x7ff8b07b14f1 in encode_with_recode_loop_and_filter encoder.c:3706:9
    #3 0x7ff8b07a1f41 in av1_encode encoder.c:4611:9
    #4 0x7ff8b0eecde7 in av1_encode_strategy encode_strategy.c:1713:7
    #5 0x7ff8b07a8765 in av1_get_compressed_data encoder.c:5360:22
    #6 0x7ff8b03a627f in encoder_encode av1_cx_iface.c:3620:20
    #7 0x7ff8b03c3dc8 in aom_codec_encode aom_encoder.c:191:11
    #8 0x7ff8afda2f26 in LibaomAv1Encoder::DoEncode libaom_av1_encoder.cc:1101:7
    #9 0x7ff8afd9af17 in LibaomAv1Encoder::Encode libaom_av1_encoder.cc:993:16
    #10 0x7ff8ae3d79d3 in SimulcastEncoderAdapter::Encode simulcast_encoder_adapter.cc:672:23
    #11 0x7ff84aee87fe in StatsCollectingEncoder::Encode stats_collecting_encoder.cc:123:20
    #12 0x7ff8aef38013 in VideoStreamEncoder::EncodeVideoFrame video_stream_encoder.cc:2226:43

0x1409738e9b27 is located 0 bytes after 688935-byte region [0x140973841800,0x1409738e9b27)
allocated by thread T5 here:
    #0 0x7ff8de4ec8df  (clang_rt.asan_dynamic-x86_64.dll+0x18004c8df)
    #1 0x7ff8b07b7dee in aom_memalign aom_mem.c:59:22
    #2 0x7ff8b086bc5a in aom_realloc_frame_buffer yv12config.c:259:12
    #3 0x7ff8b086c2f8 in aom_alloc_frame_buffer yv12config.c:274:12
    #4 0x7ff8b07b143e in encode_with_recode_loop_and_filter encoder.c:3706:9

SUMMARY: AddressSanitizer: heap-buffer-overflow yv12extend.c:313:5 in aom_yv12_copy_v_c

References

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 chroma_check function retrieves scale factors only for the LAST_FRAME reference and reuses them for GOLDEN_FRAME and ALTREF_FRAME, which have different resolutions in spatial SVC, leading to an out-of-bounds buffer offset calculation.

Impact

A web page could trigger a heap buffer overflow write, potentially leading to memory corruption and possibly code execution, though the report only demonstrates a crash under ASAN.

What the attacker needed

Victim visits a malicious web page; browser supports WebRTC AV1 SVC encoding

How it was found

  1. Configure the build with ASAN enabled.
  2. Build Chrome with the ASAN configuration.
  3. Run Chrome with the provided PoC HTML file that opens a WebRTC peer connection with AV1 SVC (L2T1 scalability mode) encoding a 1280x720 canvas stream.
  4. Observe the heap-buffer-overflow in the ASAN report within seconds of encoding.

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.

This is a memory corruption bug in a video encoder library used by web browsers. When a web page starts a video call using a specific encoding mode, the encoder miscalculates where to write data and writes past the end of a buffer, which could crash the browser or potentially allow code execution.

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.