Out of bounds read in WebRTC (CVE-2026-11096)
A heap out-of-bounds read occurs in the WebRTC video encoder when a VideoFrame has a visible_rect larger than its natural_size, causing the encoder to read past a downscaled buffer. This leaked renderer heap memory can be encoded and sent over WebRTC to a remote peer.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 57 days
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 security team.
Overview: A potential heap out-of-bounds read exists in RTCVideoEncoder when processing a crafted VideoFrame. If a frame has a visible_rect larger than its natural_size, the encoder scales the frame down but attempts to read from the scaled buffer using the original, larger dimensions, resulting in an OOB read. This leaked memory can be encoded and transmitted over WebRTC.
Affected files:
third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc
Estimated timestamp from git blame: 2025-10-02
Description
A potential heap out-of-bounds (OOB) read vulnerability exists in the renderer process on platforms supporting hardware video encoding with native input (e.g., ChromeOS). The issue is located in RTCVideoEncoder::Impl::CreateNV12SharedImageFrame within third_party/blink/renderer/platform/peerconnection/rtc_video_encoder.cc.
The vulnerability is triggered when a VideoFrame is created with a visible_rect that is significantly larger than its natural_size (the display size). While Blink and the media layer validate that visible_rect fits within coded_size, they do not enforce that visible_rect must be smaller than or equal to natural_size.
When such a frame is routed to the hardware encoder (e.g., via a MediaStreamTrackGenerator), RTCVideoEncoder::Impl::EncodeOneFrameWithNativeInput may decide to convert it to an NV12 SharedImage.
-
It calls
CreateNV12SharedImageFrame. -
The method allocates a new NV12 SharedImage using the dimensions of the original frame's
visible_rect. -
It then extracts an I420 buffer by calling
frame_buffer.ToI420(). Becausenatural_sizediffers fromvisible_rect, theConvertToWebRtcVideoFrameBufferutility downscales the frame to matchnatural_size. The returnedI420Bufferis only large enough to hold thenatural_sizedimensions. -
However,
CreateNV12SharedImageFrameextracts the width and height for the copy operation from the original frame'svisible_rect:C++ const size_t width = frame->visible_rect().width(); const size_t height = frame->visible_rect().height(); -
libyuv::I420ToNV12is then invoked with these large dimensions, causing it to read far past the bounds of the small, downscaledI420Buffer.
Impact
This is a renderer-process information leak. The massive OOB read copies adjacent renderer heap memory into the NV12 SharedImage. This image is then passed to the hardware encoder, compressed, and sent over the active RTCPeerConnection. A remote attacker can decode the stream to view or extract the leaked heap contents.
Suggested Reproduction Steps
Note: These are potential steps as our tooling cannot execute a full Proof-of-Concept.
- On a platform with a hardware WebRTC encoder (e.g., ChromeOS), host a page that creates a large 1920x1080 canvas and generates an
ImageBitmap. - Use WebCodecs to create a
VideoFramefrom the bitmap with mismatched dimensions:visibleRect: {x: 0, y: 0, width: 1920, height: 1080}displayWidth: 640displayHeight: 480
- Push this frame into a
MediaStreamTrackGeneratorconfigured for video. - Add the track to an
RTCPeerConnectionand connect to a remote peer. - Observe an ASAN heap-buffer-overflow READ crash in
libyuv::I420ToNV12(or underlying copy functions) within the renderer process. On a non-ASAN build, observe the leaked memory in the decoded video stream on the remote peer.
Suggested Fix
In RTCVideoEncoder::Impl::CreateNV12SharedImageFrame, do not use the original frame->visible_rect() to determine the copy dimensions. Instead, use the actual dimensions of the extracted i420_buffer:
const size_t width = i420_buffer->width();
const size_t height = i420_buffer->height();
Additionally, the nv12_shared_image allocation and the final WrapMappableSharedImage call should also use these dimensions to ensure consistency across the conversion process.
Evaluated with Chrome root at commit: f200f57a19490707ff8bc7aa5de3cbc443a3afad
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
The encoder uses the original frame's visible_rect dimensions instead of the actual dimensions of the downscaled I420 buffer when copying pixels.
Impact
A remote attacker could decode the stream to view or extract leaked renderer heap contents, though the text notes this is a potential issue and reproduction steps are not fully verified.
What the attacker needed
Platform with hardware WebRTC encoder; victim visits a crafted page; remote peer connection
The fix
The fix should use the actual dimensions of the extracted i420_buffer for the copy and allocation instead of the original visible_rect.
How it was found
- Host a page that creates a large canvas and generates an ImageBitmap.
- Create a VideoFrame with visibleRect larger than displayWidth and displayHeight.
- Push the frame into a MediaStreamTrackGenerator for video.
- Add the track to an RTCPeerConnection and connect to a remote peer.
- Observe an ASAN heap-buffer-overflow READ crash or leaked memory in the decoded stream.
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 frame is prepared for sending, the code sometimes shrinks it to a smaller display size but then mistakenly uses the original larger size to copy pixels. That makes the program read past the end of the smaller buffer, pulling in nearby memory that should not be shared. The leaked memory is then compressed and sent to the other person on the call.
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.