Use after free in Media (CVE-2026-11060)
A shared CdmProxyImpl object's internal hash maps are mutated concurrently from two threads without synchronisation, causing map corruption and a double-free of COM pointers. An attacker could potentially achieve remote code execution in the MediaFoundationService utility process, though no working proof of concept exists.
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. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the security team.
Overview: CdmProxyImpl instances are shared across multiple MediaFoundationRenderers that use the same Content Decryption Module (CDM). Its internal absl::flat_hash_map members are mutated concurrently by the Chromium task runner and the Windows Media Foundation threadpool without synchronization. This lack of thread safety can lead to map corruption, a double-free of COM pointers, and potential RCE in the MediaFoundationService utility process.
Affected files:
media/cdm/win/media_foundation_cdm.ccmedia/cdm/win/media_foundation_cdm.h
Estimated timestamp from git blame: 2021-06-01
Summary
CdmProxyImpl (defined in media/cdm/win/media_foundation_cdm.cc) is a RefCountedThreadSafe class that implements MediaFoundationCdmProxy. A single instance of CdmProxyImpl is shared across all MediaFoundationRenderer instances that are bound to the same MediaFoundationCdm (i.e., when multiple video elements share the same MediaKeys object).
CdmProxyImpl maintains two absl::flat_hash_map members:
input_trust_authorities_: Maps a stream ID to itsComPtr<IMFInputTrustAuthority>.last_key_ids_: Maps a stream ID to its last used Key ID.
These maps are accessed and mutated concurrently from two different execution contexts without any synchronization primitives (such as a base::Lock), leading to a critical data race.
Technical Details
The vulnerability is triggered by concurrent access from the following threads:
-
Windows Media Foundation (MF) Threadpool:
MediaFoundationSourceWrapper::GetInputTrustAuthorityis called by the OS on an MF threadpool thread. This directly callsCdmProxyImpl::GetInputTrustAuthority, which inserts the createdIMFInputTrustAuthorityintoinput_trust_authorities_.MediaFoundationSourceWrapper::~MediaFoundationSourceWrapperis a COM object destructor that runs on the thread releasing the final reference, which is often an MF threadpool thread when the pipeline tears down. This destructor callsCdmProxyImpl::SetLastKeyId, modifyinglast_key_ids_.
-
Chromium Media Task Runner:
- When a
MediaFoundationRendereris initialized, it callsMediaFoundationSourceWrapper::SetCdmProxy()on the media task runner. - This invokes
CdmProxyImpl::RefreshTrustedInput(), which iterates overinput_trust_authorities_and then explicitly callsclear()on bothinput_trust_authorities_andlast_key_ids_.
- When a
Because absl::flat_hash_map is not thread-safe, a concurrent insertion (from the MF threadpool) and clear() (from the task runner) causes undefined behavior. It can tear the internal control bytes of the map, tricking the map's slot destruction logic into destructing a ComPtr that is simultaneously being written or has already been freed. This results in a Use-After-Free (UAF) and a double Release() call on the COM object.
Potential Exploit Scenario
Note: These are potential steps to trigger the bug. We don't yet have a working proof of concept that has been successfully run.
- An attacker creates a malicious web page that instantiates an Encrypted Media Extensions (EME) session, creating a
MediaKeysobject. - The attacker creates two HTML
<video>elements (Video 1 and Video 2) and attaches the exact sameMediaKeysobject to both viasetMediaKeys(). - The attacker assigns an encrypted source to Video 1 and starts playback. The browser creates a
MediaFoundationRendererin theMediaFoundationServiceutility process. - The
MediaFoundationRendererinitializes and creates a sharedCdmProxyImplinstance. - Video 1's Media Foundation pipeline starts up on the Windows MF threadpool. It requests the Input Trust Authority, causing the MF thread to insert an item into the
input_trust_authorities_map. - Concurrently, the attacker assigns a source to Video 2 to start its playback.
- Video 2's
MediaFoundationRendererinitializes on the Chromium media task runner, acquiring the sameCdmProxyImplinstance. - Video 2's initialization calls
RefreshTrustedInput(), which begins iterating and callingclear()on the map. - The concurrent mutation and clearing corrupts the hash map. The map destroys a
ComPtrleading to a doubleRelease(). - Since
Release()performs a virtual call (vtable->Release()), an attacker who has groomed the heap can hijack the control flow, potentially achieving Remote Code Execution (RCE) within theMediaFoundationServiceprocess.
Recommendation
Synchronize access to the internal maps in CdmProxyImpl.
- The most straightforward fix is to add a
base::LocktoCdmProxyImpland acquire it inGetInputTrustAuthority,SetLastKeyId,RefreshTrustedInput, andOnHardwareContextReset. - Alternatively, restrict all map modifications to a single sequence (e.g., the Chromium media task runner) by using
base::BindPostTaskto bounce calls from the MF threadpool to the task runner, though this may introduce latency into the COM calls.
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 absence of any locking around two absl::flat_hash_map members that are accessed from both the Windows Media Foundation threadpool and the Chromium media task runner.
Impact
A heap-grooming attacker could potentially hijack control flow and achieve remote code execution within the MediaFoundationService utility process, but no working proof of concept has been demonstrated.
What the attacker needed
Windows with Media Foundation; victim visits a malicious page; page uses Encrypted Media Extensions; two video elements share one MediaKeys
The fix
Access to the internal maps should be synchronised, for example by adding a lock around the relevant methods or by restricting all modifications to a single task runner.
How it was found
- Create a web page that starts an Encrypted Media Extensions session, producing a MediaKeys object.
- Create two video elements and attach the same MediaKeys object to both.
- Assign an encrypted source to the first video and start playback, causing a renderer to be created.
- The renderer initialises and creates a shared CdmProxyImpl instance.
- The first video's pipeline requests the Input Trust Authority, inserting an entry into the map on the Media Foundation thread.
- Concurrently start playback on the second video, whose renderer initialisation calls RefreshTrustedInput and clears the map.
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.
Two parts of the browser can change the same list of items at the same time without taking turns, which corrupts the list. This can cause the browser to free the same object twice, and a skilled attacker might turn that into running their own code. The report is a theoretical analysis, not a proven attack.
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.