Inappropriate implementation in Media (CVE-2026-9991)
A GPU-process callback in the Windows Media Foundation video encoder produced a shared image without first making the correct GL context current, so it could inherit a stale thread-local context belonging to another origin. A compromised renderer could then have its texture ID collide with a victim's texture and receive the victim's pixel data back through the encoded bitstream, or crash the GPU process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 14 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 Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential vulnerability in the Media Foundation Video Encode Accelerator (MFVEA) could allow a compromised renderer to leak GPU texture data from other origins. The issue stems from failing to ensure a GL context is current before performing operations that rely on thread-local GL state. This leads to cross-origin texture ID confusion when using the passthrough command decoder.
Affected files:
media/base/win/mf_helpers.ccgpu/command_buffer/service/shared_image/d3d_image_representation.ccmedia/gpu/windows/media_foundation_video_encode_accelerator_win.cc
Estimated timestamp from git blame: 2025-01-28
Root Cause analysis
In media/base/win/mf_helpers.cc, the function media::GenerateResourceOnSyncTokenReleased() calls SharedImageManager::ProduceVideo() without first ensuring that a valid GL context is made current on the executing thread.
The callback for GenerateResourceOnSyncTokenReleased is scheduled on a dedicated GPU scheduler sequence (wait_sequence_id_) created by CommandBufferHelperImpl. This sequence executes on the GPU main thread but lacks associated GL context management. In Chrome's GPU process, gl::g_current_gl_context is a thread_local variable. For performance, CommandBufferStub tasks leave the last used GL context current on the thread rather than clearing it upon completion. Consequently, when the MFVEA callback executes, it inherits whatever GL context was left bound by the previous task—likely a WebGL context belonging to a different renderer origin.
Potential execution Flow
When a mailbox resolves to a GLTextureImageBacking (which a compromised renderer can trigger by requesting GLES2_READ|WRITE usage), the following potential execution flow occurs:
SharedImageManager::ProduceVideocallsGLTextureImageBacking::ProduceVideo, which invokesD3D11VideoImageCopyRepresentation::CreateFromGLingpu/command_buffer/service/shared_image/d3d_image_representation.cc.CreateFromGLretrieves the stalethread_localGL context fromgl::g_current_gl_context.- It then issues GL commands, including
glCopySubTextureCHROMIUM(gl_texture_id, ...). Here,gl_texture_idis the service ID of the attacker's SharedImage (allocated in theSharedContextState's namespace). - Under the passthrough command decoder, every WebGL context and the
SharedContextStatehave distinct GL share groups. Service IDNfrom the attacker's namespace may refer to a completely different texture in the victim's stale context.
Because ANGLE allocates texture IDs sequentially, achieving an ID collision is trivial. If a collision occurs, the victim's texture contents are copied into a D3D destination texture, which is then encoded by the Media Foundation Video Encode Accelerator. The resulting bitstream is then returned to the attacker's renderer.
If no collision occurs or the stale context is in an error state, the code may hit a release-fatal CHECK_EQ(glGetError(), GL_NO_ERROR) in d3d_image_representation.cc, resulting in a GPU process crash.
Impact
This constitutes a potential high-severity cross-origin information leak, allowing an attacker to read pixel data from GPU textures belonging to other origins. Alternatively, it can be used to cause a Denial of Service by crashing the GPU process.
Suggested Fix
The fix is to ensure the SharedContextState's GL context is made current before calling ProduceVideo. This matches the implementation already present in the sibling D3D12 encoder (media/gpu/windows/d3d12_video_encode_accelerator.cc:149).
// Suggested change in media/base/win/mf_helpers.cc
if (!shared_image_stub->shared_context_state()->MakeCurrent(nullptr)) {
RETURN_ON_FAILURE_WITH_CALLBACK(E_FAIL, "Failed to make context current");
}
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
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 video-encode callback called ProduceVideo without making the SharedContextState's GL context current, so it used whatever thread-local GL context a previous task had left bound.
Impact
This could leak pixel data from GPU textures belonging to other origins, or crash the GPU process for a denial of service; it requires an already compromised renderer.
What the attacker needed
Compromised renderer; Windows GPU process with passthrough decoder
The fix
The SharedContextState's GL context should be made current before calling ProduceVideo, matching the sibling D3D12 encoder.
How it was found
- A compromised renderer requests a shared image with GLES2 read and write usage so the mailbox resolves to a GL texture backing.
- The video encode callback runs on the GPU scheduler sequence and ProduceVideo reaches CreateFromGL.
- CreateFromGL picks up the stale thread-local GL context left by an earlier task.
- It issues a texture copy using the attacker's service texture ID, which may collide with a different texture in the stale context.
- The copied pixels are encoded by the video encoder and the bitstream is returned to the attacker's renderer.
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.
Chrome's graphics work runs in a separate GPU process, and that process reuses one thread for many tasks. Each task is supposed to set up its own drawing context (the state that says which textures belong to whom) before touching textures, but this code skipped that step. So it could pick up the context left behind by a previous task, which may belong to a different website, and copy that site's texture data into the attacker's video output.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.