CVE-2026-8585
Overview
Files Changed
media/gpu/windows/media_foundation_video_encode_accelerator_win.cc
Patch
From 65ff0534249fe614b4e40d7f155d801071a72eca Mon Sep 17 00:00:00 2001 From: Dale Curtis <[email protected]> Date: Fri, 03 Apr 2026 13:01:23 -0700 Subject: [PATCH] [MFVEA] Promote DCHECK to error handling This protects against a compromised renderer requesting a frame size change at an unexpected time. R=eugene Fixed: 499052720 Change-Id: I621891344f7b94e5878af3e2c1873f2d936b927e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7728102 Auto-Submit: Dale Curtis <[email protected]> Reviewed-by: Eugene Zemtsov <[email protected]> Commit-Queue: Eugene Zemtsov <[email protected]> Cr-Commit-Position: refs/heads/main@{#1609923} --- diff --git a/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc b/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc index 58983a5..48ad40b 100644 --- a/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc +++ b/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc @@ -1103,7 +1103,15 @@ DCHECK(activate_); DCHECK(encoder_); DCHECK_NE(input_visible_size_, frame_size); - DCHECK(pending_input_queue_.empty()); + + // This is not normally possible, but a compromised renderer could cause it + // to be reached. + if (!pending_input_queue_.empty()) { + NotifyErrorStatus({EncoderStatus::Codes::kEncoderIllegalState, + "Can't change frame size when there are pending input " + "frames"}); + return; + } if (!IsFrameSizeAllowed(frame_size)) { NotifyErrorStatus({EncoderStatus::Codes::kEncoderUnsupportedConfig,
Original Bug Report
Potential GPU OOB read and info leak in MediaFoundationVideoEncodeAccelerator due to stale queue
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: MediaFoundationVideoEncodeAccelerator fails to clear its pending input queue when reconfiguring for a new resolution. A compromised renderer can exploit this to queue a small buffer, reconfigure the encoder to a large resolution, and cause the underlying MFT to perform an out-of-bounds read. The leaked GPU process memory is encoded into the bitstream and returned to the attacker.
Affected files:
media/gpu/windows/media_foundation_video_encode_accelerator_win.cc
Estimated timestamp from git blame: 2024-12-03
Vulnerability Details
The MediaFoundationVideoEncodeAccelerator (MFVEA) on Windows contains a flaw in how it handles dynamic resolution changes via UpdateFrameSize(). When a resolution change occurs, the accelerator reconfigures the underlying Media Foundation Transform (MFT) but fails to properly flush or clear its internal pending_input_queue_.
In media/gpu/windows/media_foundation_video_encode_accelerator_win.cc, UpdateFrameSize() uses a DCHECK to assert that the queue is empty before proceeding:
// media/gpu/windows/media_foundation_video_encode_accelerator_win.cc:1036
DCHECK(pending_input_queue_.empty());
Because DCHECK macros are compiled out in Release builds, execution proceeds even if the queue contains frames. The method updates the input_visible_size_ and reconfigures the MFT to the new dimensions. While it explicitly clears bitstream_buffer_queue_ (line 1143), it leaves pending_input_queue_ untouched.
Potential Exploitation Steps
Note: These steps are based on static analysis; a working Proof of Concept has not yet been executed.
- Queue a Small Frame: A compromised renderer process floods the GPU process with asynchronous
EncodeMojo IPCs containing smallVideoFrameobjects (e.g., 16x16). - Buffer Allocation:
QueueInput()createsIMFSamplebuffers for these frames based on the current 16x16input_visible_size_and pushes them ontopending_input_queue_. - Trigger Resolution Change: Before the hardware encoder finishes processing, the attacker sends a
RequestEncodingParametersChangeIPC with a large resolution (e.g., 1920x1080). - Reconfiguration: The GPU process calls
UpdateFrameSize(), bypassing theDCHECK. The MFT is reconfigured to expect 1080p frames, andinput_visible_size_becomes 1920x1080. The 16x16 samples remain inpending_input_queue_. - Feeding Stale Inputs: When the MFT signals
METransformNeedInput,FeedInputs()dequeues the stale 16x16 sample and passes it toencoder_->ProcessInput()without verifying the sample’s buffer size against the newinput_visible_size_. - Out-of-Bounds Read: The vendor MFT driver (Intel, NVIDIA, AMD) relies on its newly configured
MF_MT_FRAME_SIZE(1080p). It assumes the provided buffer is large enough and reads past the end of the 16x16 allocation, resulting in an out-of-bounds read into adjacent GPU heap memory. - Information Leak: The leaked heap memory is encoded as video data and returned to the renderer via the
BitstreamBufferReadycallback, allowing the attacker to bypass ASLR or steal cross-origin texture data.
Suggested Fix
There are two primary ways to fix this issue:
- Clear the Queue on Reconfiguration: In
UpdateFrameSize(), explicitly clear thepending_input_queue_and properly discard/notify the client about the dropped frames, similar to howbitstream_buffer_queue_is cleared. - Validate Sample Size Before Processing: Add a check in
ProcessInput()orFeedInputs()to ensure that theIMFSamplebuffer dimensions match the currently configuredinput_visible_size_. If they do not match, the sample should be rejected rather than passed to the hardware encoder.
Evaluated with Chrome root at commit: ff3d2b74fa39431785bd60e51463b08fcc71ee33
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.