Buffer overflow in WebRTC (CVE-2026-78891)
A signed/unsigned mismatch in the VP9 RTP packetizer of libwebrtc lets a JavaScript-controlled encoded frame with a payload size of 0xFFFFFFFF be truncated to -1, which then becomes SIZE_MAX in a memcpy. An attacker could trigger a large heap buffer overflow write past the RTP packet buffer from web content using the WebRTC Encoded Transform API.
- Fix shipped in 4 months
Security Bug
Important: Please do not change the component of this bug manually.
Please READ THIS FAQ before filing a bug: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/security/faq.md
Please see the following link for instructions on filing security bugs: https://www.chromium.org/Home/chromium-security/reporting-security-bugs
Reports may be eligible for reward payments under the Chrome VRP: https://g.co/chrome/vrp
NOTE: Security bugs are normally made public once a fix has been widely deployed.
VULNERABILITY DETAILS NOTE At Mozilla we are tracking this at https://bugzilla.mozilla.org/show_bug.cgi?id=2029717 . I can CC someone to that bug if so desired.
The VP9 RTP packetizer in libwebrtc passes a size_t payload size to SplitAboutEqually(), which takes a signed int parameter. When a JavaScript-controlled WebRTC encoded frame has a payload of 0xFFFFFFFF bytes (4GB-1), the implicit cast truncates this to int -1. The release-build-only RTC_DCHECK_GT(payload_len, 0) does not catch this, and the subsequent check max_payload_len >= single_packet_reduction_len + (-1) passes trivially, returning a single-element vector containing -1. NextPacket() then reads packet_payload_len = -1, calls AllocatePayload(header_size + (-1)) = AllocatePayload(10) which succeeds with a tiny buffer, and finally calls memcpy(buffer + header_size, src, -1) where -1 implicitly converts to SIZE_MAX, causing a massive heap-buffer-overflow write past the ~1200-byte RTP packet buffer.
The trigger path is fully reachable from web content with default Firefox configuration. The WebRTC Encoded Transform API (media.peerconnection.scripttransform.enabled, default true) allows JavaScript to set frame.data to an arbitrary ArrayBuffer. Firefox supports ArrayBuffers up to 16GB on 64-bit platforms. The data path from RTCEncodedFrameBase::SetData through TransformableVideoSenderFrame, EncodedImageBuffer, RTPSenderVideo::SendVideo, and RtpPacketizer::Create uses size_t throughout — no truncation occurs until the final SplitAboutEqually call.
In production, exploitation requires ~8GB of free memory (4GB for the JS ArrayBuffer plus 4GB for the EncodedImageBuffer copy). The test patch substitutes a 16KB buffer with a faked 4GB size to make the bug observable under ASAN, but the truncation logic and the resulting memcpy(SIZE_MAX) are identical to production behavior.
VERSION Chrome Version: 147 stable Operating System:
REPRODUCTION CASE
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION Type of crash: [tab, browser, etc.] Crash State: [see link above: stack trace with symbols, registers, exception record] Client ID (if relevant): [see link above]
CREDIT INFORMATION Externally reported security bugs may appear in Chrome release notes. If this bug is included, how would you like to be credited? Reporter credit: [goes here]
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
A size_t payload length was passed to a function taking a signed int, so a 4GB-1 value truncated to -1, bypassed a release-only assertion, and was later converted to SIZE_MAX in a memcpy length.
Impact
A web page could cause a heap buffer overflow write in the browser process, which may lead to a crash and potentially memory corruption; in production it requires roughly 8GB of free memory.
What the attacker needed
Default Firefox configuration; WebRTC Encoded Transform enabled; ~8GB free memory in production
How it was found
- Use the WebRTC Encoded Transform API from JavaScript to set an encoded frame's data to an ArrayBuffer with a payload of 0xFFFFFFFF bytes.
- Let the frame travel through the sender pipeline to the VP9 RTP packetizer.
- Observe the truncation to -1 and the resulting oversized memcpy write under ASAN.
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.
WebRTC lets browsers send video and audio directly to each other, and the code that chops video frames into network packets is called a packetizer. Here a very large frame size was stored in a signed number, so it wrapped around to a negative value, and that negative value was then used as a copy length, making the program write far past the end of a small buffer. This kind of out-of-bounds write can crash the browser and, in principle, be turned into 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.