Skip to content
Race condition Advisory Advanced CVE-2026-7985

Use after free in GPU (CVE-2026-7985)

A data race in the GPU process allows a compromised renderer to concurrently mutate process-global static vectors, leading to heap corruption and use-after-free. This could enable a renderer-to-GPU sandbox escape and arbitrary code execution in the GPU process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 36 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 security team.

Overview: A data race in GpuVideoEncodeAcceleratorFactory allows a compromised renderer to trigger concurrent mutation of process-global static vectors. This leads to heap corruption, double-frees, and use-after-free in the GPU process, providing a path for a renderer-to-GPU sandbox escape.

Affected files:

  • media/gpu/gpu_video_encode_accelerator_factory.cc
  • gpu/ipc/service/gpu_service_impl.cc
  • media/mojo/services/mojo_video_encode_accelerator_provider.cc

Estimated timestamp from git blame: 2026-02-03

Summary

Multiple thread-safety issues exist in media/gpu/gpu_video_encode_accelerator_factory.cc due to unsynchronized access and mutation of process-global static variables. These functions can be invoked concurrently by multiple threads in the GPU process. This can be triggered by a compromised renderer through the viz.mojom.Gpu and media.mojom.VideoEncodeAcceleratorProvider Mojo interfaces.

Technical Details

1. The Threading Model

When a renderer requests a Video Encode Accelerator, the request is routed to the GPU process at viz::GpuServiceImpl::CreateVideoEncodeAcceleratorProvider (components/viz/service/gl/gpu_service_impl.cc:593).

Crucially, to prevent blocking the main GPU sequence, GpuServiceImpl allocates a new ThreadPool task runner for each provider request (except on Fuchsia where it reuses a single thread). On Windows, it creates a new COMSTATaskRunner; on other platforms, it creates a new SequencedTaskRunner or SingleThreadTaskRunner (gpu_service_impl.cc:614-621).

If a compromised renderer binds multiple viz.mojom.Gpu providers, it can simultaneously invoke methods on all of them, causing the GPU process to execute those methods concurrently across distinct physical threads in the ThreadPool.

2. Unsynchronized Initialization in GetVEAFactoryFunctions

The most critical race exists in GetVEAFactoryFunctions (media/gpu/gpu_video_encode_accelerator_factory.cc:165). This function lazily populates a process-global static vector of callbacks:

C++
  static base::NoDestructor<std::vector<VEAFactoryFunction>>
      vea_factory_functions;
  if (gpu_preferences.disable_accelerated_video_encode)
    return *vea_factory_functions;
  if (!vea_factory_functions->empty()) {
    return *vea_factory_functions;
  }

#if BUILDFLAG(USE_VAAPI)
  vea_factory_functions->push_back(base::BindRepeating(&CreateVaapiVEA));
// ... more push_backs ...

While C++11 guarantees that the initialization of the NoDestructor static object (calling the std::vector default constructor) is thread-safe, it provides no synchronization for subsequent modifications.

If multiple threads concurrently enter this function while vea_factory_functions is empty, they will all pass the empty() check. They will then concurrently execute push_back. This causes concurrent vector reallocations and deterministic double-frees of the backing store.

Furthermore, the elements being added are base::RepeatingCallback objects. When the corrupted vector is returned by value at the end of the function (return *vea_factory_functions;), the copy constructor invokes AddRef() on the internal BindState of each callback. Because the backing store was concurrently reallocated and freed, these BindState pointers point to freed memory. The AddRef() operation therefore writes to freed memory, providing a highly reliable and exploitable Use-After-Free (UAF) primitive.

3. Unsynchronized Mutation in GetSupportedProfiles

A similar race exists in GpuVideoEncodeAcceleratorFactory::GetSupportedProfiles() (media/gpu/gpu_video_encode_accelerator_factory.cc:284).

C++
  static base::NoDestructor<VideoEncodeAccelerator::SupportedProfiles> profiles(
      GetSupportedProfilesInternal(gpu_preferences, gpu_workarounds,
                                   gpu_device));
// ...
  if (gpu_workarounds.disable_accelerated_vp9_encode) {
    std::erase_if(*profiles, [](const auto& vea_profile) {
      return vea_profile.profile >= VP9PROFILE_PROFILE0 &&
             vea_profile.profile <= VP9PROFILE_PROFILE3;
    });
  }

After thread-safe initialization, multiple threads can concurrently execute std::erase_if operations on the static vector based on GPU driver bug workarounds. Concurrent std::erase_if operations lead to data races on the vector's internal state (e.g., size_ adjustments and memmove operations on the backing store), resulting in heap corruption or UAF during the copy-constructor return.

On V4L2 platforms, an additional race exists where *profiles = ... (gpu_video_encode_accelerator_factory.cc:303) can invoke concurrent std::vector::operator=, leading to deterministic double-frees of the backing store.

Potential Attack Surface and Trigger

The vulnerability is reachable from a compromised renderer. Suggested steps for an attacker:

  1. Bind viz.mojom.Gpu via the BrowserInterfaceBroker.
  2. Call Gpu.CreateVideoEncodeAcceleratorProvider multiple times. Each call creates a new task runner in the GPU process thread pool.
  3. Each provider is bound to its own task runner. The renderer then simultaneously calls GetVideoEncodeAcceleratorSupportedProfiles or CreateVideoEncodeAccelerator on all provider remotes.
  4. These Mojo dispatches result in concurrent execution of the vulnerable static-accessing code in the GPU process, triggering the UAF or heap corruption.

Note: Our tooling agent has not executed these steps to provide a working proof-of-concept.

Impact

This is a renderer-to-GPU sandbox escape primitive. Successful exploitation allows for arbitrary code execution within the GPU process. The GPU process has a broader sandbox than the renderer, including direct access to driver ioctls and hardware acceleration APIs.

Suggested Fix

The simplest and most robust fix is to use a lock (base::Lock) inside GetVEAFactoryFunctions and GetSupportedProfiles to protect the initialization and mutation of the static variables. Alternatively, use base::OnceFlag to ensure the vector is populated exactly once before it can be read.

Evaluated with Chrome root at commit: e9e0fcbb690b1a8c1a26c81c2a9ea23d6e178368


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 code uses process-global static vectors that are lazily initialised and then mutated without any locking, so concurrent calls from multiple threads cause data races and memory corruption.

Impact

This is a renderer-to-GPU sandbox escape primitive that could allow arbitrary code execution within the GPU process, which has a broader sandbox than the renderer.

What the attacker needed

Compromised renderer; ability to bind Mojo interfaces

The fix

The code should be fixed by adding a lock (base::Lock) around the initialisation and mutation of the static variables, or by using base::OnceFlag to ensure the vector is populated exactly once.

How it was found

  1. Bind the viz.mojom.Gpu interface via the BrowserInterfaceBroker.
  2. Call Gpu.CreateVideoEncodeAcceleratorProvider multiple times to create new task runners.
  3. Simultaneously call GetVideoEncodeAcceleratorSupportedProfiles or CreateVideoEncodeAccelerator on all provider remotes.
  4. The concurrent Mojo dispatches execute the vulnerable static-accessing code, triggering the use-after-free or heap corruption.

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 data race happens when two parts of a program access the same memory at the same time without coordination, causing unpredictable results. Here, a malicious webpage (running in a restricted 'renderer' process) can ask the GPU process to do several things at once, corrupting memory. This could let the attacker break out of the renderer's sandbox and run code in the more powerful GPU process.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.