Out of bounds write in Codecs (CVE-2026-8569)
The H.265 decoder only re-checks sequence parameters on IRAP pictures, so a mid-stream SPS with larger dimensions can overwrite the active SPS without triggering buffer reallocation. An attacker could then make the hardware decode a larger frame into a smaller DMA buffer, causing an out-of-bounds write.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Flapjack (go/flapjack), an LLM-powered static analysis tool, has identified the following potential security issue.
Overview: The H265Decoder fails to check for resolution changes when processing non-IRAP frames. An attacker can inject a mid-stream Sequence Parameter Set (SPS) with larger dimensions that unconditionally overwrites the active SPS, causing the hardware to decode a larger frame into a smaller, previously allocated DMA buffer.
Affected files:
media/parsers/h265_parser.ccmedia/gpu/h265_decoder.ccmedia/parsers/h265_parser.h
Estimated timestamp from git blame: 2023-10-10
Description
A highly exploitable memory safety vulnerability exists in the way media::H265Decoder handles mid-stream Sequence Parameter Set (SPS) changes for HEVC/H.265 video streams.
In media/parsers/h265_parser.cc, the ParseSPS method parses an SPS NALU and stores it in the active_sps_ map, keyed strictly by the sps_seq_parameter_set_id. If a new SPS with the same ID is provided, it unconditionally overwrites the existing SPS without validating if the resolution or other critical parameters have changed.
Simultaneously, in media/gpu/h265_decoder.cc, the decoder checks for sequence parameter changes (like resolution changes) by calling ProcessPPS(). If a change is detected, it returns kConfigChange, prompting the GPU process to re-allocate the pool of hardware DMA buffers (e.g., V4L2 or VAAPI surfaces) to fit the new dimensions. However, this check is only performed for IRAP (Instantaneous Decoding Refresh) pictures. If a non-IRAP slice (such as a TRAIL_R predicted frame) is processed, the ProcessPPS() check is skipped:
// media/gpu/h265_decoder.cc
if (curr_slice_hdr_->irap_pic) { // <--- Flaw: Only checks on IRAP pictures
bool need_new_buffers = false;
if (!ProcessPPS(curr_slice_hdr_->slice_pic_parameter_set_id, &need_new_buffers)) {
SET_ERROR_AND_RETURN();
}
if (need_new_buffers) {
curr_pic_ = nullptr;
return kConfigChange;
}
}
Impact
An attacker can trigger a highly reliable Out-of-Bounds (OOB) hardware DMA write, leading to Sandbox Escape and Privilege Escalation (to the GPU process or kernel).
Because the OOB write is performed by the hardware DMA engine, it completely bypasses C++ memory safety mitigations like MiraclePtr and user-space bounds checks.
Note on original report: The original vulnerability report suggested using an enhancement layer NALU (nuh_layer_id > 0) to overwrite the base layer. While effective on macOS where IsAlphaLayerSupported() is true, on Linux/ChromeOS platforms (V4L2/VAAPI), NALUs with nuh_layer_id > 0 are explicitly skipped by the decoder. The exploit is actually simpler and universal: the attacker simply uses nuh_layer_id == 0 for the malicious mid-stream SPS, which achieves the same overwrite and works across all platforms.
Steps to Trigger
- Establish legitimate stream: The attacker provides a valid 1080p SPS, PPS, and an IRAP slice.
ProcessPPS()is called, and the decoder allocates a pool of 1080p hardware DMA buffers. - Mid-stream SPS Injection: The attacker injects a malicious SPS NALU into the bitstream with
sps_seq_parameter_set_id = 0, but specifying a 4K resolution (e.g., 3840x2160).H265Parser::ParseSPSunconditionally overwritesactive_sps_[0]with this new 4K SPS. - Non-IRAP Slice: The attacker immediately provides a non-IRAP slice (e.g.,
TRAIL_R) referencing PPS ID 0. - Bypass Reallocation: Because
curr_slice_hdr_->irap_picis false,ProcessPPS()is skipped. The decoder does not returnkConfigChangeand the hardware buffer pool remains sized for 1080p. - Fetch Hardware Buffer: The decoder acquires a surface via
CreateH265Picture(), which is backed by a 1080p DMA buffer. - Fetch Malicious Parameters: In
StartNewFrame(), the decoder fetches the active SPS (parser_.GetSPS(curr_sps_id_)). It retrieves the malicious 4K SPS. - Hardware Submission: The decoder submits the frame metadata to the hardware delegate (e.g.,
V4L2VideoDecoderDelegateH265::SubmitFrameMetadata). The delegate copies the 4K dimensions from the SPS directly into the hardware driver's command structures. - OOB DMA Write: The hardware DMA engine is instructed to decode a 4K frame into the provided 1080p buffer. The hardware writes decoded macroblocks past the bounds of the allocated physical memory, corrupting adjacent kernel slabs or GPU process heap memory.
Evaluated with Chrome root at commit: 818af3d59a508e1d651545a5bed0175ff7406aa3
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 decoder only calls ProcessPPS() to detect parameter changes on IRAP pictures, while ParseSPS unconditionally overwrites the active SPS for any frame, so a non-IRAP slice can change resolution without triggering buffer reallocation.
Impact
An attacker could trigger a reliable out-of-bounds hardware DMA write, potentially leading to sandbox escape and privilege escalation, and this bypasses C++ memory safety mitigations; the text notes the original layer-based approach was skipped on Linux/ChromeOS, but the simpler same-layer variant is claimed to work across platforms.
What the attacker needed
Attacker-supplied H.265 bitstream; victim decodes the crafted video
How it was found
- Provide a valid 1080p SPS, PPS and IRAP slice so the decoder allocates 1080p DMA buffers.
- Inject a mid-stream SPS with the same ID but 4K dimensions, overwriting the active SPS.
- Send a non-IRAP slice referencing the same PPS ID so the reallocation check is skipped.
- The decoder fetches the 4K SPS and submits frame metadata to the hardware delegate.
- The hardware decodes a 4K frame into the 1080p buffer, writing past its bounds.
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.
Video files are split into small chunks called frames, and the decoder keeps a description of the video's size so it can reserve the right amount of memory. This report says the decoder only re-reads that description at certain frame types, so a crafted stream can quietly change the size and make the hardware write more data than the memory was sized for. That overflow can corrupt memory outside 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.