Skip to content
Memory corruption Advisory Advanced CVE-2026-79182

Improper input validation in Media (CVE-2026-79182)

The VideoToolbox H.265 accelerator caches SPS bytes by ID without layer namespacing, so an alpha-layer SPS can overwrite the base-layer SPS mid-frame. Slices validated against the larger base-layer SPS are then passed to the macOS driver with the smaller alpha-layer format description, potentially causing out-of-bounds slice addresses in the hardware decoder.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 38 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: The VideoToolbox H.265 accelerator caches SPS bytes by ID without layer namespacing, allowing an alpha-layer SPS to overwrite the base-layer SPS mid-frame. Slices validated against a large base-layer SPS are passed to the macOS driver paired with the overwritten small alpha-layer format description. This potentially passes out-of-bounds slice segment addresses to the Apple hardware decoder.

Affected files:

  • media/gpu/mac/video_toolbox_h265_accelerator.cc
  • media/gpu/h265_decoder.cc
  • media/parsers/h265_parser.cc
  • media/gpu/mac/video_toolbox_h265_accelerator.h

Estimated timestamp from git blame: 2023-09-20

1. Summary of the Issue (Meant for Human Triage)

In the VideoToolbox H.265 hardware video decoder on macOS, a state desynchronization vulnerability exists between the Chromium-side slice header parser and the format description passed to the native Apple driver. The VideoToolboxH265Accelerator caches Sequence Parameter Set (SPS) raw bytes in a map (seen_sps_data_) keyed solely by the sps_seq_parameter_set_id, without namespacing or disambiguating by the NALU layer ID (nuh_layer_id).

Furthermore, the auxiliary alpha-layer SPS parsing branch in H265Decoder::Decode() does not trigger FinishPrevFrameIfPresent(), a crucial frame-flushing mechanism that is enforced on the base layer. This discrepancy allows an attacker to supply an auxiliary/alpha layer SPS mid-picture that shares the same ID as the active base-layer SPS. The raw bytes of the alpha-layer SPS completely overwrite the base-layer SPS bytes in the accelerator's cache.

When the frame is finalized, the accelerator uses the overwritten, smaller alpha-layer SPS to construct the CMVideoFormatDescription. The native Apple decoder (VTDecompressionSessionDecodeFrame) then receives slice headers that were previously validated by Chromium against the larger base-layer SPS. Because the format description passed to the driver specifies much smaller dimensions, fields like slice_segment_address can bypass parser protections and appear completely out-of-bounds to the underlying macOS GPU process, potentially leading to driver-side memory corruption.


2. Proof-of-Concept & Detailed Execution Flow

Note: The following steps describe a potential execution flow based on static analysis. Our tooling agent does not yet have the ability to run code, but this sequence demonstrates how an attacker could hypothetically trigger the vulnerability.

An attacker serving a malicious H.265 bitstream (via WebCodecs, MSE, or <video src> on macOS where hardware HEVC is enabled by default) can craft a sequence to force a cache collision:

  1. Bitstream Initialization: The stream starts with a Video Parameter Set (VPS) indicating aux_alpha_layer_id = 1.
  2. Base-Layer SPS parsing: The stream provides a base-layer SPS (SPS_A) with nuh_layer_id = 0, sps_seq_parameter_set_id = 0, and large spatial dimensions (e.g., pic_size_in_ctbs_y = 16384). The decoder processes it in H265Decoder::Decode (media/gpu/h265_decoder.cc:450-457), calling FinishPrevFrameIfPresent(). The raw bytes are cached in the accelerator via VideoToolboxH265Accelerator::ProcessSPS (media/gpu/mac/video_toolbox_h265_accelerator.cc:64-65): seen_sps_data_[0] = SPS_A bytes.
  3. PPS parsing: A base-layer PPS (PPS_A) referencing sps_id = 0 is parsed and cached.
  4. First Base-Layer Slice: An IDR slice (Slice 0) with first_slice_segment_in_pic_flag = 1 starts a new frame. It is submitted via accelerator_->SubmitSlice, which captures the active parameter set IDs (frame_sps_ids_.insert(0)) and records the slice into frame_slice_data_.
  5. Attacker Payload Slice: A second IDR slice (Slice 1) with first_slice_segment_in_pic_flag = 0 carries an artificially large slice_segment_address (e.g., 16383).
  6. Parser Validation: During H265Parser::ParseSliceHeader (media/parsers/h265_parser.cc:1161-1164), the slice is bounds-checked against the active SPS (SPS_A). IN_RANGE_OR_RETURN(shdr->slice_segment_address, 0, sps->pic_size_in_ctbs_y - 1) succeeds because SPS_A allows sizes up to 16384. This slice is appended to frame_slice_data_.
  7. Alpha-Layer SPS Overwrite Payload: The stream provides an alpha-layer SPS (SPS_B) with nuh_layer_id = 1, using the same sps_seq_parameter_set_id = 0, but specifying minimal dimensions (e.g., pic_size_in_ctbs_y = 1).
  8. Missing Frame Flush: In H265Decoder::Decode, the alpha-layer bypass branch is taken (media/gpu/h265_decoder.cc:264-340). Execution hits the H265NALU::SPS_NUT case (media/gpu/h265_decoder.cc:313-319). Crucially, this branch lacks a call to FinishPrevFrameIfPresent().
  9. Cache Collision: accelerator_->ProcessSPS is called with SPS_B. seen_sps_data_[0] is silently overwritten with the small SPS_B bytes.
  10. Format Description Creation: The stream ends (kEOStream). FinishPrevFrameIfPresent flushes the frame, calling accelerator_->SubmitDecode(). This triggers CreateFormat() (media/gpu/mac/video_toolbox_h265_accelerator.cc:274-276).
  11. Apple Driver Initialization: CreateFormat calls ExtractParameterSetData, looking up ID 0 in seen_sps_data_. It retrieves the corrupted/overwritten SPS_B bytes. It passes these to CMVideoFormatDescriptionCreateFromHEVCParameterSets (media/gpu/mac/video_toolbox_h265_accelerator.cc:130-137), initializing active_format_ to a highly restrictive 1-CTB format description.
  12. Driver Handoff: SubmitDecode creates a CMSampleBuffer binding the restrictive active_format_ with the previously accumulated frame_slice_data_ (which contains Slice 1 with slice_segment_address = 16383). This is dispatched to the native Apple driver via VTDecompressionSessionDecodeFrame.
  13. Driver-Side Exploitation Consequence: Assuming the opaque native Apple VideoToolbox driver relies on the Format Description bounds without independently re-validating the slice segment addresses on-the-fly, the driver will perform an out-of-bounds write using the 16383 index into a 1-CTB configuration, resulting in memory corruption within the sandboxed macOS GPU process.

3. Technical Verification Details (Automated Audit Logs)

The report accurately identifies a driver validation bypass in VideoToolboxH265Accelerator.

  1. seen_sps_data_ (in the accelerator) and active_sps_ (in the parser) are keyed solely by sps_seq_parameter_set_id, without nuh_layer_id namespacing.
  2. In H265Decoder::Decode(), the alpha-layer SPS parsing branch (unlike the base-layer branch) does not call FinishPrevFrameIfPresent().
  3. An attacker can supply an alpha-layer SPS with the same ID as the base-layer SPS mid-frame. This overwrites the cached seen_sps_data_ and active_sps_ with the smaller alpha SPS bytes.
  4. Prior slices in the frame were already parsed, and their fields (such as slice_segment_address) were validated against the larger base-layer SPS.
  5. During SubmitDecode(), the overwritten (smaller) SPS is used to construct the CMVideoFormatDescription.
  6. This mismatched format description is passed alongside the slice data to VTDecompressionSessionDecodeFrame, effectively passing an out-of-bounds slice_segment_address (and other bounded fields) to the underlying hardware decoder.

The consequence depends on opaque Apple driver behavior (whether VideoToolbox gracefully errors or performs an out-of-bounds write). Because the macOS GPU process is sandboxed, an actual memory corruption would be High (S1) severity (sandboxed RCE). Given the opaque and unproven driver-side memory corruption, downgrading to Medium (S2) is correct per the GPU validating-layer gap severity guidelines. This issue is A-SERVER reachable via web bitstreams since HEVC is default-enabled on macOS.

Codebase Investigator Output:

  • The investigator confirmed VideoToolboxH265Accelerator::ProcessSPS keying at media/gpu/mac/video_toolbox_h265_accelerator.cc:57-66 uses solely sps->sps_seq_parameter_set_id with no layer-awareness.
  • The investigator confirmed the alpha-layer branch (media/gpu/h265_decoder.cc:313-321) explicitly lacks FinishPrevFrameIfPresent(), whereas the base layer branch (media/gpu/h265_decoder.cc:450-457) correctly invokes it.
  • The investigator confirmed IN_RANGE_OR_RETURN bounds checking at media/parsers/h265_parser.cc:1161-1164 evaluates against the currently active SPS (sps->pic_size_in_ctbs_y).
  • The investigator confirmed ExtractParameterSetData passes the mapped data to CMVideoFormatDescriptionCreateFromHEVCParameterSets at media/gpu/mac/video_toolbox_h265_accelerator.cc:130-137.

Suggested Fix:

  1. Modify VideoToolboxH265Accelerator::seen_sps_data_ (and related structures for VPS/PPS) to namespace keys by both sps_seq_parameter_set_id and nuh_layer_id (e.g., using a struct or packed integer (nuh_layer_id << 16) | sps_id).
  2. Add CHECK_ACCELERATOR_RESULT(FinishPrevFrameIfPresent()) to the alpha-layer SPS and PPS decoding branches (H265NALU::SPS_NUT and H265NALU::PPS_NUT around line 313 in media/gpu/h265_decoder.cc) to enforce the same frame boundaries as the base layer.

Evaluated with Chrome root at commit: b96d2ec58f4f5f92b540a723966b199d6e9951b4


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 accelerator's SPS cache is keyed only by sps_seq_parameter_set_id without nuh_layer_id, and the alpha-layer SPS branch does not flush the current frame, allowing a mid-frame overwrite.

Impact

Potentially passes out-of-bounds slice segment addresses to the Apple hardware decoder, which could lead to memory corruption within the sandboxed macOS GPU process, though the report notes this depends on opaque driver behaviour.

What the attacker needed

MacOS with hardware HEVC enabled; victim loads a malicious H.265 bitstream; attacker controls the video stream

The fix

The accelerator's SPS cache should be keyed by both sps_seq_parameter_set_id and nuh_layer_id, and the alpha-layer SPS and PPS branches should call FinishPrevFrameIfPresent() like the base layer.

How it was found

  1. Start a stream with a VPS that sets an auxiliary alpha layer ID.
  2. Provide a base-layer SPS with large dimensions and a matching PPS.
  3. Send a first base-layer IDR slice that starts a new frame.
  4. Send a second IDR slice with a large slice_segment_address that passes validation against the base-layer SPS.
  5. Send an alpha-layer SPS with the same SPS ID but minimal dimensions, overwriting the cached base-layer SPS without flushing the frame.
  6. End the stream so the frame is flushed and the overwritten SPS is used to build the format description passed to the Apple driver.

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 decoder reads small configuration blocks called SPS to know how big each frame is. This report says the decoder stores those blocks in a table keyed only by a number, so a second block with the same number but a different layer can replace the first one while a frame is still being built. The frame's slices were checked against the old, larger size, but the hardware is later given the new, smaller size, which could make it read or write outside its 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.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.