Skip to content
Memory corruption Advisory Advanced CVE-2023-39928

Webkit MediaRecorder API stopRecording use-after-free vulnerability

A use-after-free flaw in WebKitGTK's MediaRecorder API occurs when stopping a recording, where a lock object is released before its destructor runs. An attacker could exploit this to cause memory corruption and potentially achieve arbitrary code execution by luring a user to a malicious webpage.

Marcin 'Icewall' Noga Follow

Originally disclosed on Cisco Talos

High 8.8 View original

A use-after-free vulnerability exists in the MediaRecorder API of Webkit WebKitGTK 2.40.5. A specially crafted web page can abuse this vulnerability to cause memory corruption and potentially arbitrary code execution.

Marcin 'Icewall' Noga, on Cisco Talos

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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 a locking object's destructor accesses memory after the underlying object has been freed, due to improper lifetime management during the stop recording process.

Impact

A malicious webpage could cause memory corruption and potentially achieve arbitrary code execution, though the text notes that proper heap grooming and timing are needed.

What the attacker needed

Victim visits a malicious webpage; browser is WebKitGTK 2.40.5

How it was found

  1. Create a media stream destination and a MediaRecorder from its stream.
  2. Start the MediaRecorder.
  3. Stop the MediaRecorder, triggering the use-after-free.

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 use-after-free bug happens when a program frees memory but then keeps using it, like deleting a file but still trying to open it. Here, the browser's recording feature mishandles memory when you stop recording, so a malicious website could corrupt memory and possibly run harmful code on your computer. You would need to visit the bad site for this to happen.

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 by Marcin 'Icewall' Noga

View all

146 more disclosed reports, best first.

More from Cisco Talos

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.