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

Use after free in Media (CVE-2026-11680)

MediaFoundationProtectionManager lacks a custom Release() override, so when the last COM reference is dropped on a Media Foundation threadpool thread, the object is destroyed off its bound sequence. This can race with pending tasks on the main task runner that hold weak pointers, potentially causing a use-after-free in the sandboxed utility process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 13 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: MediaFoundationProtectionManager lacks a custom Release() implementation, which allows it to be destructed on an asynchronous Media Foundation threadpool thread rather than its bound sequence. This leads to the potential cross-thread destruction of sequence-affine members such as base::CancelableOnceClosure and base::WeakPtrFactory. Consequently, a race condition occurs with pending tasks on the main task runner, potentially resulting in a Use-After-Free (UAF) vulnerability.

Affected files:

  • media/renderers/win/media_foundation_protection_manager.h
  • media/renderers/win/media_foundation_protection_manager.cc

Estimated timestamp from git blame: 2020-03-11

Root Cause

MediaFoundationProtectionManager is a WRL RuntimeClass handed to the closed-source MFMediaEngine via IMFMediaEngineProtectedContent::SetContentProtectionManager(). MFMediaEngine retains references to it and invokes its methods asynchronously on Media Foundation (MF) threadpool threads.

Unlike its sibling COM wrappers (MediaFoundationSourceWrapper and MediaFoundationStreamWrapper), MediaFoundationProtectionManager does not override Release() to safeguard destruction on the correct sequence. When MFMediaEngine drops the last reference on an MF threadpool thread, the default WRL RuntimeClass::Release() is invoked, running the destructor off the bound sequence runner (task_runner_).

This leads to the potential cross-thread destruction of sequence-affine members:

C++
scoped_refptr<base::SequencedTaskRunner> task_runner_;
WaitingCB waiting_cb_;
base::CancelableOnceClosure waiting_for_key_time_out_cb_;   // must be destroyed on bound sequence
...
base::WeakPtrFactory<MediaFoundationProtectionManager> weak_factory_{this};  // Invalidate() must run on bound sequence

Because WeakReference::Flag::Invalidate() sequence assertions are restricted to DCHECK builds, in official/release builds the cross-thread destruction proceeds unchecked, causing a race condition with pending tasks on task_runner_ that hold live WeakPtrs.

Potential Vulnerability Mechanism

Based on static analysis, we have identified the following potential path to trigger the UAF:

  1. Playback of encrypted content (such as PlayReady HW-DRM) instantiates MediaFoundationProtectionManager and registers it with MFMediaEngine via SetContentProtectionManager().
  2. MFMediaEngine calls BeginEnableContent() on an MF threadpool thread, which posts OnBeginEnableContent to task_runner_ via a weak pointer. This arms a 500 ms delayed task OnWaitingForKeyTimeOut holding a WeakPtr inside the protection manager.
  3. Upon player teardown (e.g. when the user navigates away or closes the media element), ~MediaFoundationRenderer executes on task_runner_ and shuts down the media engine. However, the media engine may asynchronously retain and release its IMFContentProtectionManager reference on its threadpool after shutdown.
  4. If the media engine drops its last COM reference on the MF thread pool while a delayed or queued task (e.g., OnWaitingForKeyTimeOut) is executing on task_runner_, a race condition occurs. Since WeakPtr sequence validation is disabled on release builds, the task on task_runner_ may proceed, invoking member functions on this just as the MF threadpool calls delete this via the default Release() implementation.
  5. The active execution on task_runner_ then dereferences the freed MediaFoundationProtectionManager or its subobjects, potentially leading to a Use-After-Free (UAF) condition:
C++
void MediaFoundationProtectionManager::OnWaitingForKeyTimeOut() {
  ...
  waiting_for_key_time_out_cb_.Cancel();          // accesses freed CancelableCallbackImpl
  waiting_cb_.Run(WaitingReason::kNoDecryptionKey); // indirect call through freed Callback bind state
}

Note: These steps are based on static analysis of the control flow and object lifecycles; our analysis tools do not currently have the capability to execute code or verify this via an active Proof of Concept.

Impact

This issue potentially leads to a use-after-free within the kMediaFoundationCdm LPAC-sandboxed utility process on Windows. If an attacker can groom or reclaim the freed allocation, they could potentially exploit this to hijack control flow and execute arbitrary code within the utility process.

Suggested Remediation

Implement a custom Release() override in MediaFoundationProtectionManager to ensure that destruction is safely routed to the designated task_runner_ via DeleteSoon if called from a different sequence, similar to sibling wrappers:

C++
IFACEMETHODIMP_(ULONG) MediaFoundationProtectionManager::Release() {
  ULONG ref_count = InternalRelease();
  if (ref_count == 0) {
    if (!task_runner_->RunsTasksInCurrentSequence()) {
      task_runner_->DeleteSoon(FROM_HERE, this);
    } else {
      delete this;
    } 
  }
  return ref_count;
}

Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8


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 class does not override Release() to route destruction back to its bound task runner, so the default WRL Release() deletes the object on whatever thread drops the last reference.

Impact

If an attacker can groom or reclaim the freed allocation, they could potentially hijack control flow and execute arbitrary code within the sandboxed utility process.

What the attacker needed

Windows with Media Foundation; Playback of encrypted content; Attacker can groom freed memory

The fix

A custom Release() override should be implemented to route destruction to the bound task runner via DeleteSoon when called from a different sequence.

How it was found

  1. Play encrypted content, which creates MediaFoundationProtectionManager and registers it with MFMediaEngine.
  2. MFMediaEngine calls BeginEnableContent on a threadpool thread, which posts a task and arms a delayed timeout holding a weak pointer.
  3. Tear down the player, shutting down the media engine while it may still hold and release its reference asynchronously.
  4. The media engine drops its last reference on the threadpool while a delayed task is running on the task runner, causing a race.
  5. The task runner dereferences the freed object, leading to a use-after-free.

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.

This is a bug in how a Windows media component frees its memory. Normally, an object must be destroyed on the same thread that created it, but here it can be destroyed on a different thread while other code is still using it. That can lead to a use-after-free, where the program reads or writes memory that has already been freed.

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.