Improper enforcement of behavioral workflow in Media (CVE-2026-79083)
The MojoDecryptorService's InitializeAudioDecoder and InitializeVideoDecoder methods lack the HasPendingReads() check that DeinitializeDecoder has, allowing a compromised renderer to re-initialize a decoder while a decrypt-and-decode read is still pending. By stalling a Mojo data pipe, an attacker could cause a queued decode to execute against mismatched decoder state, potentially leading to memory corruption or a use-after-free in the sandboxed CDM process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 months
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: A potential security vulnerability in MojoDecryptorService allows a compromised renderer to bypass pending read state checks when re-initializing an audio or video decoder. By stalling a Mojo DataPipe, an attacker could queue a decode request, re-initialize the decoder with a different configuration, and then resume the pipe to execute the decode operation against mismatched decoder state. This state violation could potentially trigger memory corruption or a Use-After-Free (UAF) in the sandboxed library CDM process.
Affected files:
media/mojo/services/mojo_decryptor_service.ccmedia/cdm/cdm_adapter.cc
Estimated timestamp from git blame: 2017-12-14
Description
A state-mutation guard bypass potentially exists in MojoDecryptorService. Chromium's implementation of MojoDecryptorService::DeinitializeDecoder contains a safety check (HasPendingReads()) to prevent the decoder from being de-initialized while a decrypt-and-decode read is still pending:
// media/mojo/services/mojo_decryptor_service.cc
void MojoDecryptorService::DeinitializeDecoder(StreamType stream_type) {
...
if (reader->HasPendingReads()) {
CHECK(mojo::IsInMessageDispatch());
mojo::ReportBadMessage(
"DeinitializeDecoder with pending DecryptAndDecode reads");
return;
}
decryptor_->DeinitializeDecoder(stream_type);
}
However, the sibling decoder entry points—InitializeAudioDecoder (lines 129–136) and InitializeVideoDecoder (lines 138–152)—do not implement any corresponding HasPendingReads() checks on their respective buffer readers.
Per the Content Decryption Module (CDM) API design (media/cdm/api/content_decryption_module.h), a library CDM allows a client to re-initialize an already-initialized decoder to adapt to dynamic configuration changes. Under normal circumstances, well-behaved clients like DecryptingVideoDecoder ensure no decodes are pending before calling initialize. However, a compromised renderer communicating directly over the mojom::Decryptor Mojo interface can bypass this sequence, causing a queued decode request to fire into a re-configured library CDM (e.g., Widevine), resulting in potential memory corruption.
Potential Attack Scenario
Because our tooling currently lacks the capability to compile and execute a functional Proof of Concept, the following steps represent a potential attack path based on static code analysis:
- Setup: A compromised renderer acquires a direct
pending_remote<Decryptor>to theMojoDecryptorServicerunning in the sandboxed utility process (sandbox::mojom::Sandbox::kCdm). - Establish Data Pipes: The renderer calls
Decryptor::Initializeand retains the producer ends of the audio/video Mojo data pipes. - Initial Configuration: The renderer calls
InitializeVideoDecoderwith a valid initial configuration (e.g., H.264) and waits for successful completion. - Queue a Stalled Read: The renderer sends a
DecryptAndDecodeVideorequest with an encrypted H.264 buffer but purposely stalls the Mojo data pipe by withholding the buffer payload bytes. On the utility process side,MojoDecoderBufferReaderqueues this read callback (OnVideoRead) and arms its pipe watcher (media/mojo/common/mojo_decoder_buffer_converter.cc). At this point,video_buffer_reader_->HasPendingReads()returnstrue. - Re-initialize Decoder: The renderer calls
InitializeVideoDecoderwith a different configuration (e.g., VP9). BecauseInitializeVideoDecoderlacks aHasPendingReads()check, the request proceeds, causing the underlyingCdmAdapterto instruct the library CDM to re-initialize for VP9. The CDM deallocates previous H.264 decoder contexts and sets up a VP9 context. - Unstall and Trigger: The renderer writes the withheld H.264 bytes into the video data pipe. The pipe watcher wakes up, completes the read, and dispatches the parked
DecryptAndDecodeVideocall to the library CDM. The CDM is forced to process the H.264 bitstream using VP9 decoder contexts, leading to potential out-of-bounds memory writes or a Use-After-Free (UAF) in the library CDM's heap.
Suggested Fix
Validate that there are no pending reads prior to decoder re-initialization. Add HasPendingReads() checks to both InitializeAudioDecoder and InitializeVideoDecoder in media/mojo/services/mojo_decryptor_service.cc, reporting a bad message if a pending read is detected:
void MojoDecryptorService::InitializeAudioDecoder(
const AudioDecoderConfig& config,
InitializeAudioDecoderCallback callback) {
DVLOG(1) << __func__;
if (audio_buffer_reader_ && audio_buffer_reader_->HasPendingReads()) {
CHECK(mojo::IsInMessageDispatch());
mojo::ReportBadMessage(
"InitializeAudioDecoder with pending DecryptAndDecode reads");
return;
}
...
}
Apply a symmetric guard to InitializeVideoDecoder as well.
Evaluated with Chrome root at commit: 57b021e1fdae94a215627d29aeb1ccf2eb5b3e91
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.
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 InitializeAudioDecoder and InitializeVideoDecoder methods in MojoDecryptorService omit the HasPendingReads() guard that DeinitializeDecoder uses, so a decoder can be re-initialized while a decrypt-and-decode read is still pending.
Impact
The state violation could potentially trigger memory corruption or a use-after-free in the sandboxed library CDM process, though the report is based on static analysis and no proof of concept was executed.
What the attacker needed
Compromised renderer; direct Mojo remote to the CDM service; ability to stall a Mojo data pipe
The fix
The fix should add HasPendingReads() checks to both InitializeAudioDecoder and InitializeVideoDecoder that report a bad message when a pending read is detected.
How it was found
- A compromised renderer obtains a direct remote to the MojoDecryptorService in the sandboxed CDM utility process.
- The renderer calls Decryptor::Initialize and keeps the producer ends of the audio and video Mojo data pipes.
- The renderer calls InitializeVideoDecoder with a valid initial configuration and waits for it to complete.
- The renderer sends a DecryptAndDecodeVideo request but withholds the buffer payload bytes, stalling the data pipe and leaving a pending read.
- The renderer calls InitializeVideoDecoder again with a different configuration, which proceeds because no pending-read check exists.
- The renderer writes the withheld bytes into the data pipe, causing the parked decode to run against the re-configured decoder.
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 media decoder in Chrome can be told to switch formats (for example, from H.264 to VP9) while it is still waiting for data to arrive for an earlier decode request. Because the code that handles the switch does not check for that waiting request, the old data can later be fed to the newly configured decoder, which may crash or corrupt memory. The report is based on reading the code, not on running an exploit.
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.