Uninitialized resource in WebRTC (CVE-2026-130958)
WebRTC's buffer pool zero-initialises 8-bit video buffers but not 10-bit ones, even though the H.264 decoder relies on that zeroing. A crafted 10-bit H.264 stream with omitted slices could leave parts of the frame unwritten, letting JavaScript read residual renderer heap memory through WebCodecs.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 7 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 without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: WebRTC's VideoFrameBufferPool fails to zero-initialize 10-bit video buffers, despite H264DecoderImpl explicitly relying on this feature to prevent uninitialized memory disclosure. By sending a crafted 10-bit H.264 stream with omitted slices, an attacker can cause FFmpeg to partially decode a frame into an uninitialized buffer. This buffer can then be read by JavaScript via WebCodecs, potentially leaking renderer heap memory.
Affected files:
third_party/webrtc/common_video/video_frame_buffer_pool.ccthird_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.ccthird_party/webrtc/api/video/i010_buffer.ccthird_party/webrtc/rtc_base/memory/aligned_malloc.cc
Estimated timestamp from git blame: 2025-04-16
Overview
WebRTC's software H.264 decoder (H264DecoderImpl) configures its VideoFrameBufferPool to explicitly zero-initialize newly allocated buffers. This is a defense-in-depth measure designed to prevent the disclosure of uninitialized heap memory in cases where FFmpeg decodes an incomplete or truncated frame, leaving portions of the output buffer unwritten.
While this zero-initialization is correctly implemented for 8-bit formats (such as I420), it is omitted for 10-bit formats (such as I010, I210, I410). Because these buffers are allocated via AlignedMalloc (which maps to PartitionAlloc's un-zeroed bucketed freelists for small resolutions), an attacker can exploit this discrepancy to reliably leak renderer heap memory to JavaScript.
Vulnerability Details
Based on source code analysis, the following sequence of events outlines how an attacker could potentially exploit this vulnerability:
- Establish WebRTC Connection: An attacker-controlled web page establishes a WebRTC
RTCPeerConnectionand negotiates a 10-bit H.264 video stream (e.g., High 10 Profile, mapping toAV_PIX_FMT_YUV420P10LE). - Decoder Initialization:
H264DecoderImplis instantiated. In its constructor, it initializes itsffmpeg_buffer_pool_withzero_initialize=true(third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc:280). - Crafted H.264 Stream: The attacker sends an H.264 access unit that is syntactically valid but intentionally omits certain slices (e.g., missing macroblock rows).
- Buffer Allocation: When FFmpeg begins decoding the frame, it requests a buffer via
H264DecoderImpl::AVGetBuffer2(). For 10-bit formats, this invokesdecoder->ffmpeg_buffer_pool_.CreateI010Buffer(width, height). - Missing Initialization: Inside
VideoFrameBufferPool::CreateI010Buffer(third_party/webrtc/common_video/video_frame_buffer_pool.cc:262), the code allocates a newI010Bufferbut fails to check thezero_initialize_flag or call any initialization method. In contrast, 8-bit methods likeCreateI420Bufferexplicitly check this flag and callInitializeData(). - Uninitialized Memory:
I010Bufferallocates its memory usingAlignedMalloc(). For typical attacker-controlled resolutions (e.g., 16x16, which requires ~768 bytes), PartitionAlloc serves the allocation from its un-zeroed freelists. Thus, the buffer contains residual renderer heap data. - Partial Decode: Because
CONFIG_ERROR_RESILIENCEis disabled (0) in Chromium's FFmpeg build, error concealment is bypassed. FFmpeg writes decoded pixels for the present slices, but leaves the memory for the omitted slices completely untouched. - Data Leakage: Because
H264DecoderImpldoes not enable theAV_EF_EXPLODEerror recognition flag (unlike Chrome's media pipeline), FFmpeg returns the partially decoded frame without error. The frame propagates to the WebRTC sink, where JavaScript can useMediaStreamTrackProcessorandVideoFrame.copyTo()to directly read the uninitialized 16-bit values, resulting in an information leak that could be used to defeat ASLR.
(Note: These are potential steps based on code analysis; our tooling has not executed a live proof-of-concept.)
Suggested Fix
- Update
I010Buffer,I210Buffer, andI410Bufferclasses to implement anInitializeData()method that safely zeroes the allocated memory (similar toI420Buffer::InitializeData()). - Update
VideoFrameBufferPool::CreateI010Buffer,CreateI210Buffer, andCreateI410Bufferto checkif (zero_initialize_) buffer->InitializeData();immediately after allocating a new buffer, bringing them in line with the 8-bit buffer creation methods.
Evaluated with Chrome root at commit: 7353d249d9cacf9c7218e1d7b8a39cf39c72d646
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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 10-bit buffer creation methods in VideoFrameBufferPool ignore the zero_initialize_ flag and never call an initialisation routine, unlike their 8-bit counterparts.
Impact
An attacker could potentially leak renderer heap memory, which may help defeat ASLR; the report notes no live proof-of-concept was executed.
What the attacker needed
Victim visits attacker page; browser supports 10-bit H.264 decoding; WebCodecs available to the page
The fix
The 10-bit buffer classes should gain an initialisation method that zeroes memory, and the pool's 10-bit creation methods should call it when zero_initialize_ is set.
How it was found
- Open an attacker page that sets up a WebRTC peer connection and negotiates a 10-bit H.264 stream.
- The H.264 decoder is created with a buffer pool configured to zero-initialise buffers.
- Send a syntactically valid H.264 access unit that omits some slices.
- FFmpeg requests a 10-bit buffer, which is allocated without being zeroed.
- FFmpeg decodes only the present slices and returns the partially filled frame without error.
- Read the frame from JavaScript via MediaStreamTrackProcessor and VideoFrame.copyTo().
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 asks the computer for memory, that memory may still hold old data from other programs. Good practice is to wipe it clean before use. Here the code wipes 8-bit video buffers but forgets to do the same for 10-bit ones, so leftover data could end up inside a video frame that a web page can read.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.