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

Use after free in WebRTC (CVE-2026-11054)

A race condition in WebRTC session description handling can cause a persistent handle to be destroyed on the wrong thread, corrupting the garbage collector's free-list and potentially leading to a use-after-free. An attacker could trigger this by creating an offer in an iframe and then removing the iframe, potentially leading to memory corruption and code execution.

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: A race condition in CreateSessionDescriptionRequest can cause a cppgc::Persistent handle to be destroyed on the WebRTC signaling thread when an iframe is detached. This causes an unsynchronized modification of the main thread's cppgc free-list, leading to Oilpan heap corruption and a potential Use-After-Free (UAF).

Affected files:

  • third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc
  • third_party/blink/renderer/platform/heap/persistent.h

Estimated timestamp from git blame: 2025-10-21

Summary

A potential vulnerability exists in rtc_peer_connection_handler.cc where CreateSessionDescriptionRequest incorrectly manages the lifecycle of a cppgc::Persistent handle. If an iframe is detached while an asynchronous WebRTC operation is pending, the request object can be destructed on the WebRTC signaling thread. cppgc::Persistent is not thread-safe; its cross-thread destruction corrupts the main thread's Garbage Collection (Oilpan) free-list, which can lead to a highly exploitable Use-After-Free (UAF).

Potential Steps to Trigger

Note: These are suggested steps based on static analysis, as our tooling agent cannot yet run live proofs of concept.

  1. An attacker hosts a page with an <iframe>.
  2. Inside the iframe, JavaScript creates a WebRTC connection and triggers peerConnection.createOffer() (or createAnswer()).
  3. Immediately after triggering the offer, the attacker's main page removes the iframe from the DOM (iframe.remove()).
  4. The WebRTC thread finishes generating the offer and attempts to return it to the main thread.
  5. The free-list is corrupted. The attacker allocates multiple objects to trigger shared nodes, then forces a garbage collection cycle to trigger a UAF on a live JavaScript/DOM object.

Technical Details

  1. When pc.createOffer() is called, Blink creates a CreateSessionDescriptionRequest (rtc_peer_connection_handler.cc:962).
  2. This object holds a cppgc::Persistent<RTCSessionDescriptionRequest> webkit_request_ to keep the JS request object alive across the async boundary.
  3. A raw pointer to this ref-counted request is passed to the native WebRTC layer, which wraps it in a scoped_refptr and passes it to the WebRTC signaling thread.
  4. When the iframe is removed, its FrameSchedulerImpl is destroyed, shutting down the frame's TaskQueue and invalidating its TaskRunner (main_thread_).
  5. Once the WebRTC signaling thread finishes the offer, it calls CreateSessionDescriptionRequest::OnSuccessUniquePtr.
  6. Because it is on a background thread, it attempts to post a task back using PostCrossThreadTask (rtc_peer_connection_handler.cc:164).
  7. The Bug: PostCrossThreadTask directly uses base::SequencedTaskRunner::PostTask. Because the main_thread_ task runner is shut down, PostTask returns false. Consequently, the base::OnceCallback and its captured scoped_refptr are destroyed immediately on the WebRTC signaling thread.
  8. This drops the final reference to the CreateSessionDescriptionRequest, invoking its destructor (and the ~Persistent destructor) on the signaling thread.
  9. PersistentRegionBase::FreeNode executes on the WebRTC thread. In Release builds, the CPPGC_DCHECK(IsCreationThread()) is compiled out, so the method writes to the main thread's free_list_head_ without taking any locks.
  10. Concurrently, the main thread may be allocating new Persistent handles. The unsynchronized writes corrupt the singly-linked free-list, allowing two live Persistent handles to share the same PersistentNode. When one is cleared, the GC will fail to trace the other, leading to a UAF.

Suggested Fix

There are two primary ways to fix this:

  1. Use CrossThreadPersistent: Change the type of webkit_request_ from cppgc::Persistent to cppgc::CrossThreadPersistent. CrossThreadPersistentRegion uses a process-global lock (PersistentRegionLock), which safely handles node allocation and destruction across thread boundaries.
  2. Safe Callback Destruction: Instead of using PostCrossThreadTask, use a mechanism that guarantees the callback and its bound arguments are destroyed on the target thread, even if the task runner is shut down. For instance, blink::BindPostTask uses base::OnTaskRunnerDeleter to ensure safe destruction, preventing the closure from being dropped on the signaling thread.

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.

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 root cause is that a `cppgc::Persistent` handle is destroyed on a background thread when a task runner is shut down, and the persistent region's free-list is not thread-safe, leading to corruption.

Impact

This could lead to a use-after-free, potentially allowing an attacker to execute arbitrary code or cause a denial of service.

What the attacker needed

Victim visits attacker's page; browser supports WebRTC

The fix

The bug should be fixed by using `CrossThreadPersistent` instead of `Persistent`, or by ensuring safe callback destruction on the target thread.

How it was found

  1. An attacker hosts a page with an iframe.
  2. Inside the iframe, JavaScript creates a WebRTC connection and triggers createOffer().
  3. Immediately after triggering the offer, the attacker's main page removes the iframe from the DOM.
  4. The WebRTC thread finishes generating the offer and attempts to return it to the main thread.
  5. The free-list is corrupted. The attacker allocates multiple objects to trigger shared nodes, then forces a garbage collection cycle to trigger a UAF.

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 report describes a bug in how a web browser handles WebRTC (a technology for real-time communication) when an iframe is removed. The bug could let an attacker corrupt the browser's memory management, potentially leading to crashes or even running malicious code. The issue is a race condition, meaning it depends on precise timing between threads.

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.