Inappropriate implementation in Media (CVE-2026-8585)
The MediaFoundationVideoEncodeAccelerator on Windows fails to clear its pending input queue when reconfiguring for a new resolution, allowing a compromised renderer to queue a small buffer, reconfigure to a large resolution, and cause an out-of-bounds read in the underlying MFT. The leaked GPU process memory is encoded into the bitstream and returned to the attacker.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 41 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 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.
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 UpdateFrameSize() method uses a DCHECK to assert the pending input queue is empty, which is compiled out in release builds, and does not clear the queue before reconfiguring the encoder.
Impact
A compromised renderer could leak GPU process memory, potentially bypassing ASLR or stealing cross-origin texture data, though the report notes these steps are based on static analysis and a working proof of concept has not been executed.
What the attacker needed
Compromised renderer process; ability to send Mojo IPCs to GPU process
The fix
The issue should be fixed by either clearing the pending input queue on reconfiguration or validating sample size before processing.
How it was found
- A compromised renderer floods the GPU process with asynchronous Encode Mojo IPCs containing small VideoFrame objects.
- QueueInput() creates IMFSample buffers for these frames and pushes them onto pending_input_queue_.
- The attacker sends a RequestEncodingParametersChange IPC with a large resolution before the hardware encoder finishes processing.
- The GPU process calls UpdateFrameSize(), bypassing the DCHECK, reconfiguring the MFT and updating input_visible_size_ while the small samples remain in pending_input_queue_.
- When the MFT signals METransformNeedInput, FeedInputs() dequeues the stale small sample and passes it to encoder_->ProcessInput() without verifying the sample's buffer size against the new input_visible_size_.
- The vendor MFT driver reads past the end of the small allocation, resulting in an out-of-bounds read into adjacent GPU heap memory.
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 encoder in the GPU process keeps a queue of frames waiting to be processed. When the resolution changes, the code checks that the queue is empty but only in debug builds, so in release builds old small frames stay in the queue. Those small frames are then fed to a hardware encoder that now expects large frames, causing it to read past the end of the small buffer and leak memory back to the attacker.
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.