Integer overflow in Codecs (CVE-2026-8573)
The VP8 parser fails to check that the compressed frame header size does not exceed the declared first_part_size, causing an integer underflow when computing the control partition size for hardware decoders. An attacker could craft a malicious WebM file to trigger out-of-bounds memory access, potentially leading to GPU memory leaks, GPU process RCE, or kernel sandbox escape.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 51 days
Flapjack (go/flapjack), an LLM-powered static analysis tool, has identified the following potential security issue.
Overview: The Vp8Parser fails to validate that the size of the compressed frame header does not exceed the first_part_size declared in the VP8 frame tag. This causes an integer underflow when calculating the control partition size for VA-API and V4L2 hardware decoders. The massive underflowed size is passed to GPU drivers and potentially the kernel, leading to out-of-bounds memory access, information leaks, or GPU process RCE.
Affected files:
media/parsers/vp8_parser.ccmedia/gpu/vaapi/vaapi_utils.ccmedia/gpu/v4l2/v4l2_video_decoder_delegate_vp8.ccmedia/gpu/vaapi/test/vp8_decoder.cc
Estimated timestamp from git blame: 2021-11-09
Summary
A potential integer underflow leading to an out-of-bounds read/write was identified in Chromium's VP8 video decoding utility. The root cause is a lack of validation in media::Vp8Parser::ParseFrameHeader (media/parsers/vp8_parser.cc), which fails to ensure that the number of bits consumed when reading the compressed frame header does not exceed the first_part_size specified in the uncompressed VP8 frame tag.
Technical Details
-
Parsing Frame Tag: In
media/parsers/vp8_parser.cc, theVp8Parser::ParseFrameTagmethod extracts thefirst_part_sizefrom the VP8 frame tag (a 19-bit value). An attacker can craft a frame tag where this value is arbitrarily small (e.g.,5). -
Parsing Compressed Header: Subsequently,
Vp8Parser::ParseFrameHeaderuses aVp8BoolDecoderto parse the compressed header. Crucially, the decoder is initialized with the entire remaining frame buffer (bytes_left_), not just thefirst_part_sizebytes. The number of bits consumed during this process is stored infhdr->macroblock_bit_offset. -
Missing Validation: The parser successfully returns without verifying that the bytes consumed for the compressed header (
(macroblock_bit_offset + 7) / 8) actually fit within thefirst_part_size. -
The Underflow: In multiple hardware video decoder delegates, such as
media/gpu/vaapi/vaapi_utils.cc(and similarly inmedia/gpu/vaapi/test/vp8_decoder.cc), the size of the first partition's macroblock data is calculated by subtracting the header size fromfirst_part_size:C++ slice_param->partition_size[0] = frame_header.first_part_size - ((frame_header.macroblock_bit_offset + 7) / 8);If the attacker-controlled
first_part_size(e.g.,5) is smaller than the consumed header size in bytes (e.g.,13), an unsigned integer underflow occurs. Sincepartition_size[0]is an unsigned 32-bit integer (uint32_tin the VA-APIVASliceParameterBufferVP8struct), it wraps around to an extremely large value (e.g.,0xFFFFFFF8).
Impact
- GPU Information Leak / ASLR Bypass: This massive size is passed directly to the VA-API hardware/driver via
vaapi_wrapper_->MapAndCopyAndExecutein the privileged GPU process. The hardware may read massively beyond the end of the provided bitstream buffer. If the driver or hardware interprets this out-of-bounds data as macroblock data and incorporates it into the decoded frame, a cross-origin attacker could render the video to a canvas, extract the pixels, and read arbitrary GPU memory contents. - Remote Code Execution (RCE): If the specific VA-API driver implementation (e.g., Intel media driver, Mesa) performs internal buffer allocations or memory copies (
memcpy) based on this massive partition size before hardware submission, it will result in a heap buffer overflow and arbitrary code execution within the GPU process. - Potential Kernel Sandbox Escape: On V4L2-based platforms (e.g., ChromeOS on ARM), these unvalidated values are copied into a
v4l2_ctrl_vp8_framestructure and passed directly to the kernel viaioctlinmedia/gpu/v4l2/v4l2_video_decoder_delegate_vp8.cc. If the kernel driver performs the same subtraction without underflow validation, it could result in a kernel-level out-of-bounds read/write and a full sandbox escape.
Potential Steps to Reproduce
Note: These are potential steps as a full Proof of Concept (PoC) has not yet been executed.
- Craft a WebM media file containing a VP8 video track.
- Modify a single VP8 keyframe in the bitstream.
- Set the
first_part_sizefield in the uncompressed frame tag to a very small value (e.g.,5). - Ensure the subsequent compressed frame header contains valid boolean entropy data that consumes more bytes than the
first_part_size(e.g., > 40 bits). - Serve this malicious WebM file via an HTML5
<video>element on an attacker-controlled webpage. - When the victim visits the page on a device supporting VA-API or V4L2 hardware decoding, the Chromium media pipeline will parse the frame without error and pass the underflowed size to the GPU driver/kernel.
Evaluated with Chrome root at commit: 9760e6c70cd33a320713361f17c6dcca85648c0f
Results from Flapjack so far have been promising, but it can be wrong in its deductions. At this time, it does not produce proof of concepts or fuzzer tests. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve Flapjack’s 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 parser does not validate that the number of bytes consumed for the compressed frame header is less than or equal to the first_part_size from the frame tag, leading to an unsigned integer underflow when calculating the partition size.
Impact
An attacker could potentially leak GPU memory contents, achieve remote code execution in the GPU process, or escape the sandbox via a kernel out-of-bounds access, depending on the driver implementation.
What the attacker needed
Victim visits attacker-controlled webpage; Device supports VA-API or V4L2 hardware decoding; Malicious WebM file served
How it was found
- Craft a WebM media file containing a VP8 video track.
- Modify a single VP8 keyframe in the bitstream.
- Set the first_part_size field in the uncompressed frame tag to a very small value (e.g., 5).
- Ensure the subsequent compressed frame header contains valid boolean entropy data that consumes more bytes than the first_part_size (e.g., > 40 bits).
- Serve this malicious WebM file via an HTML5 <video> element on an attacker-controlled webpage.
- When the victim visits the page on a device supporting VA-API or V4L2 hardware decoding, the Chromium media pipeline will parse the frame without error and pass the underflowed size to the GPU driver/kernel.
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.
A video file contains a small header that says how big the next part is. The program trusts that number without checking if the next part is actually bigger. If the next part is bigger, subtracting the two numbers wraps around to a huge value, which is then used to read or write memory far beyond the intended buffer.
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.