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

Insufficient validation of untrusted input in Media (CVE-2026-11041)

A compromised renderer can send a DecoderBuffer with subsample metadata that describes more bytes than the actual data size. This unvalidated metadata is passed to the Media Foundation utility process, potentially causing an out-of-bounds memory access in a decryptor and allowing a sandbox escape.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 2 months

Project Fortify, an experimental security project, has identified the following potential security issue.

Overview: A compromised renderer can provide malicious subsample metadata in a DecoderBuffer that exceeds the buffer's data size. This unvalidated metadata is passed to the Media Foundation (MF) utility process and converted into an IMFSample, potentially triggering an out-of-bounds memory access in an MF decryptor. This can lead to a sandbox escape from the renderer into the higher-privilege MF CDM utility process on Windows.

Affected files:

  • media/base/win/mf_helpers.cc
  • media/mojo/services/mojo_demuxer_stream_adapter.cc
  • media/renderers/win/media_foundation_stream_wrapper.cc
  • media/mojo/common/media_type_converters.cc

Estimated timestamp from git blame: 2024-01-30

Vulnerability Summary

A potential security vulnerability exists in the MediaFoundation-based decryption path on Windows where subsample geometry provided by a renderer process is not validated before being passed to the Media Foundation (MF) utility process. A compromised renderer can supply a DecoderBuffer over the mojom::DemuxerStream Mojo pipe with a DecryptConfig whose subsamples describe more bytes than are actually present in the buffer's data. This unvalidated metadata is subsequently used to create an IMFSample attribute in the MF CDM utility process, leading to a potential out-of-bounds (OOB) read or write.

Technical Details

In the MediaFoundationRenderer implementation, media data flows from the MojoDemuxerStreamImpl in the renderer process to the MojoDemuxerStreamAdapter in the MF utility process. The vulnerability arises from a lack of validation during this data flow:

  1. Missing Validation on Reception: When a DecoderBuffer is received via Mojo in the MF utility process, MojoDemuxerStreamAdapter::OnBufferRead (media/mojo/services/mojo_demuxer_stream_adapter.cc:127) processes the buffer but fails to call media::DecoderBuffer::DoSubsamplesMatch(). This helper function is used in other decryption paths (like DecryptingVideoDecoder) to ensure that the sum of clear and encrypted bytes in the subsamples matches the buffer's data size.
  2. Unvalidated Type Conversion: The media::TypeConverter for DecoderBuffer in media/mojo/common/media_type_converters.cc deserializes the Mojo struct and populates the DecryptConfig and its subsamples without any integrity checks against the buffer's overall size.
  3. Insecure IMFSample Creation: The unvalidated buffer is passed to GenerateSampleFromDecoderBuffer in media/base/win/mf_helpers.cc:673 (called by media/renderers/win/media_foundation_stream_wrapper.cc). This function translates the DecoderBuffer into a Windows Media Foundation IMFSample. It allocates an OS-level IMFMediaBuffer of size N (the actual data size) and copies the data into it.
  4. Malicious Metadata Attachment: Because the buffer is encrypted, AddEncryptAttributes (media/base/win/mf_helpers.cc:150) is called. This helper iterates through the unvalidated decrypt_config.subsamples() and attaches them as an MFSampleExtension_Encryption_SubSample_Mapping blob to the IMFSample without any bounds checking against the N byte data length.
  5. OOB Memory Access: The resulting IMFSample contains a memory buffer of size N, but the subsample mapping attribute describes a size M (where M > N). When this sample is processed by a decrypting Media Foundation Transform (MFT), such as the PlayReady MFT in the MF CDM utility process, the MFT may rely on the provided subsample mapping. If the MFT iterates through this mapping without re-validating it against the buffer's actual length, it results in an OOB read. For in-place decryption (such as AES-CTR or AES-CBC), this also results in an OOB write.

Impact

An attacker who has compromised the renderer process can potentially achieve memory corruption (OOB read/write) in the Media Foundation CDM utility process. As defined in sandbox/policy/win/sandbox_win.cc:581, this process runs in a less restrictive sandbox with JobLevel::kInteractive to allow it to launch the protected media pipeline process (mfpmp.exe). Furthermore, it runs with the LPAC USER_UNPROTECTED token, granting more privileges than the renderer. Exploiting this OOB write allows the attacker to execute arbitrary code within this less-restricted context, achieving a sandbox escape and privilege escalation on Windows systems using hardware-secure EME playback.

Suggested Attack Steps

(Note: These are potential steps; our tooling agent does not have the ability to run code to provide a working PoC.)

  1. Compromise a renderer process and initiate encrypted media playback (e.g., via Encrypted Media Extensions) to establish a connection to the Media Foundation CDM utility process.
  2. Construct a malicious media::mojom::DecoderBuffer message to send to the utility process over the mojom::DemuxerStream interface.
  3. Set the data_size of the Mojo DecoderBuffer to a valid value N (e.g., 100 bytes).
  4. Populate the decrypt_config field of the Mojo DecoderBuffer with an array of subsamples where the sum of clear_bytes and cipher_bytes equals M, where M is significantly larger than N (e.g., 1000 bytes).
  5. Send the metadata over the Mojo message pipe, and the N bytes of actual media data over the associated Mojo DataPipe.
  6. The MF CDM utility process will deserialize the buffer, create an IMFSample with an N-byte buffer and the M-byte subsample mapping, and pass it to a decrypting MFT, potentially triggering the OOB memory access.

Recommended Fix

The media::DecoderBuffer::DoSubsamplesMatch() check must be enforced when receiving DecoderBuffer objects from a Mojo stream in the Media Foundation renderer path. This validation should occur as soon as the data is received and reassembled from the untrusted renderer process.

Specifically, a check like if (buffer->is_encrypted() && !media::DecoderBuffer::DoSubsamplesMatch(*buffer)) should be added to MojoDemuxerStreamAdapter::OnBufferRead in media/mojo/services/mojo_demuxer_stream_adapter.cc:127. If the subsamples do not match the buffer size, the stream adapter should abort the read or fail gracefully.

Evaluated with Chrome root at commit: 4859e669de60239572397b559c17dfab074511e9


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.

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 Media Foundation utility process fails to validate that the sum of clear and encrypted bytes in the subsample metadata matches the actual buffer data size before creating an IMFSample.

Impact

An attacker who has compromised the renderer process could achieve memory corruption in the Media Foundation CDM utility process, which runs with fewer sandbox restrictions, potentially leading to a sandbox escape and privilege escalation on Windows systems using hardware-secure EME playback.

What the attacker needed

Compromised renderer process; encrypted media playback (EME) on Windows

The fix

The fix should enforce the DoSubsamplesMatch check when receiving DecoderBuffer objects from a Mojo stream in the Media Foundation renderer path, aborting the read if the subsamples do not match the buffer size.

How it was found

  1. Compromise a renderer process and start encrypted media playback to connect to the Media Foundation CDM utility process.
  2. Construct a malicious DecoderBuffer message with a data_size of N and subsample metadata summing to M, where M is larger than N.
  3. Send the metadata over the Mojo message pipe and the actual N bytes of media data over the associated Mojo DataPipe.
  4. The utility process deserialises the buffer, creates an IMFSample with an N-byte buffer and M-byte subsample mapping, and passes it to a decrypting MFT, potentially triggering an out-of-bounds memory access.

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 renderer process is the part of a browser that displays web pages and is kept in a sandbox for safety. If an attacker takes over the renderer, they can send crafted messages to a more privileged helper process that handles encrypted media. This report shows that the helper process trusts the message's description of how many bytes are encrypted, without checking it against the actual data size, which can lead to memory corruption and escape from the sandbox.

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.