Skip to content
Memory corruption Write-up Advanced

PixelSmash – FFmpeg's MagicYUV decoder vuln leads to RCE via media file

A heap out-of-bounds write in FFmpeg's MagicYUV decoder is caused by a rounding mismatch in slice height calculations, allowing an attacker to overwrite heap memory with attacker-controlled bytes. The researchers escalated this to remote code execution on Jellyfin and Nextcloud by hijacking a function pointer in the AVBuffer struct, though ASLR was disabled for the demonstration.

jfrog.com

Published on jfrog.com

JFrog Security Research recently discovered and disclosed a critical vulnerability in FFmpeg, the world’s most widely deployed media processing framework. The discovered vulnerability, which we’ve named PixelSmash, is CVE-2026-8461 – a heap out-of-bounds write in the MagicYUV decoder (CVSS 8.8 High).

The author, on jfrog.com

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a rounding mismatch: the frame allocator computes chroma plane height using ceiling-rounded shifts on an aligned height, while the decoder computes per-slice chroma heights from an attacker-controlled odd slice_height, causing accumulated extra rows to exceed the allocated buffer.

Impact

The out-of-bounds write alone causes denial of service (crashes) across many media applications, and with ASLR disabled the researchers achieved remote code execution as the service user on Jellyfin and Nextcloud; with ASLR enabled the exploit does not land, and the separate info leak they found is only informational and not chained.

What the attacker needed

Ability to deliver a crafted media file; target uses FFmpeg with MagicYUV decoder; for RCE: ASLR disabled (demonstration only)

The fix

FFmpeg was fixed by adding validation that rejects malformed slice_height values that would cause the out-of-bounds write; users should upgrade to the fixed version or disable the MagicYUV decoder at build time.

How it was found

  1. Craft a media file with an odd slice_height value in the MagicYUV bitstream.
  2. Deliver the file to an application that uses FFmpeg to decode it (e.g., upload to Jellyfin or Nextcloud).
  3. The decoder computes chroma rows per slice with ceiling rounding, exceeding the allocated chroma plane buffer.
  4. The out-of-bounds write deposits attacker-controlled bytes onto the adjacent AVBuffer struct.
  5. The overwritten AVBuffer.free pointer is set to system() and opaque to a command string.
  6. When av_buffer_unref is called during frame cleanup, the hijacked function pointer executes the attacker's command.

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 write-up has not been written yet. The Original tab links to the source.

A video decoder inside FFmpeg makes a small arithmetic mistake when handling certain video files, writing one row of data past the end of a memory buffer. Because that extra data is controlled by the attacker, they can overwrite a function pointer that FFmpeg later calls, turning a crash into running their own commands. The researchers showed this works against media servers that automatically process uploaded videos.

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.

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.