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

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

A use-after-free vulnerability exists in MediaRemotingInterstitial due to a garbage collection phase ordering issue, where a timer started during pre-finalization creates a weak handle that is not cleared, leading to execution on freed memory. An attacker could potentially achieve remote code execution by spraying the heap to control the freed object's vtable.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 6 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 Chrome Security team.

Overview: A Use-After-Free vulnerability exists in MediaRemotingInterstitial due to an Oilpan GC phase ordering issue. A timer initiated during an HTMLMediaElement pre-finalizer creates a WeakPersistent handle after the garbage collector has already processed weak handles, allowing the timer to fire on a swept object.

Affected files:

  • third_party/blink/renderer/core/html/media/media_remoting_interstitial.cc
  • third_party/blink/renderer/core/html/media/html_media_element.cc
  • third_party/blink/renderer/core/html/media/html_video_element.cc
  • third_party/blink/renderer/platform/media/web_media_player_impl.cc

Estimated timestamp from git blame: 2025-08-26

Summary

A potential Use-After-Free (UAF) vulnerability exists in the Renderer process due to an interaction between Blink's garbage collector (Oilpan) and MediaRemotingInterstitial.

When an HTMLMediaElement is garbage collected, its pre-finalizer initiates a shutdown sequence that calls Hide() on its associated MediaRemotingInterstitial. This method starts a HeapTaskRunnerTimer. Because this timer is started during the pre-finalization phase—which occurs after Oilpan's weak processing phase (ProcessWeakness)—the newly created WeakPersistent handle is not cleared during the current GC cycle. Consequently, the task runner retains a dangling pointer to the unmarked interstitial, which is subsequently swept and its memory reclaimed. When the timer fires, execution continues on the reclaimed memory.

Technical Details & Exploitation Path

  1. GC Phase Ordering Bug:

    • During a full GC cycle, Oilpan first marks live objects.
    • It then enters ProcessWeakness (v8/src/heap/cppgc/marker.cc:322), clearing WeakPersistent handles that point to unmarked objects.
    • Next, it calls ExecutePreFinalizers (v8/src/heap/cppgc/heap.cc:202).
    • HTMLMediaElement has a pre-finalizer (Dispose) that synchronously calls web_media_player_->Shutdown(), which then calls HTMLVideoElement::MediaRemotingStopped(), ultimately invoking remoting_interstitial_->Hide().
    • Hide() calls toggle_interstitial_timer_.StartOneShot(), which creates a new WeakPersistent to the MediaRemotingInterstitial object. Because ProcessWeakness has already run, this weak handle is not cleared in the current cycle.
    • The MediaRemotingInterstitial is then swept and its memory is freed.
  2. Use-After-Free:

    • 300ms later, the delayed task executes HeapTaskRunnerTimer::RunInternalTrampoline.
    • The trampoline checks the WeakPersistent pointer. Since it was never cleared, it unwraps to a non-null, dangling pointer.
    • The trampoline invokes MediaRemotingInterstitial::ToggleInterstitialTimerFired() on the freed memory.
  3. Remote Code Execution (RCE):

    • An attacker can spray the Oilpan heap to reclaim the freed MediaRemotingInterstitial memory, placing a forged vtable pointer at the beginning of the object and controlling its internal state.
    • Inside ToggleInterstitialTimerFired, the code checks IsVisible() and state_. By controlling the sprayed memory, the attacker can set state_ to kHidden, forcing execution into the else if (state_ == kHidden) branch.
    • This branch calls SetInlineStyleProperty(...) on this.
    • Element::SetInlineStyleProperty eventually calls InlineStyleChanged, which invokes the virtual method InvalidateStyleAttribute() on this.
    • This virtual call dereferences the attacker's forged vtable pointer, leading to direct Remote Code Execution within the renderer process.
    • Note: Because the object is managed by Oilpan (Blink GC), it is not protected by MiraclePtr (BackupRefPtr), which primarily protects PartitionAlloc allocations.

Suggested Reproduction Steps

Note: These are potential steps as our tooling agent cannot execute code to verify the PoC directly.

  1. Create an <video> element with a playable source via JavaScript.
  2. Trigger Media Remoting (e.g., video.remote.prompt()) so the MediaRemotingInterstitial is created and reaches state_ == kVisible.
  3. Pause the video, remove it from the DOM, and drop all JavaScript references to the element.
  4. Force a full garbage collection (e.g., by allocating large ArrayBuffers).
  5. Spray the Oilpan heap with objects containing a forged vtable to reclaim the interstitial's memory.
  6. Wait >300ms for the toggle_interstitial_timer_ to fire.

Suggested Fix

The core issue is that MediaRemotingInterstitial holds a timer that can be started during its destruction sequence but is never explicitly stopped when the object is swept.

We recommend adding a pre-finalizer to MediaRemotingInterstitial that explicitly stops the timer:

C++
// media_remoting_interstitial.h
class MediaRemotingInterstitial final : public HTMLDivElement {
  USING_PRE_FINALIZER(MediaRemotingInterstitial, Dispose);
  // ...
  void Dispose();
};

// media_remoting_interstitial.cc
void MediaRemotingInterstitial::Dispose() {
  toggle_interstitial_timer_.Stop();
}

Alternatively, ToggleInterstitialTimerFired could check if the object is still alive or valid, though explicit cleanup via a pre-finalizer is the standard approach in Blink for objects holding active timers.

Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b


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 MediaRemotingInterstitial starts a timer during the pre-finalization phase, after weak handles have been processed, so the timer's weak reference is not cleared and later fires on freed memory.

Impact

An attacker could potentially achieve remote code execution within the renderer process by controlling the freed memory and hijacking a virtual call.

What the attacker needed

Victim visits a malicious page; browser supports Media Remoting

The fix

The fix should add a pre-finalizer to MediaRemotingInterstitial that explicitly stops the timer.

How it was found

  1. Create a video element with a playable source via JavaScript.
  2. Trigger Media Remoting so the MediaRemotingInterstitial is created and reaches state_ == kVisible.
  3. Pause the video, remove it from the DOM, and drop all JavaScript references to the element.
  4. Force a full garbage collection (e.g., by allocating large ArrayBuffers).
  5. Spray the Oilpan heap with objects containing a forged vtable to reclaim the interstitial's memory.
  6. Wait >300ms for the toggle_interstitial_timer_ to fire.

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 memory safety bug in a web browser's media component. When an object is cleaned up by the garbage collector, a timer is started that later tries to use the already-freed object, which could let an attacker run their own code. The bug is in how the cleanup phases are ordered, so the timer's reference isn't cleared in time.

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.