Skip to content
DoS Write-up Intermediate

The bug was twenty-one months old and nobody was going to fix it

A division-by-zero crash in FFmpeg's VPK demuxer was triggered by a crafted file with zero channels, but the same root cause had been publicly documented twenty-one months earlier. An attacker could crash the process, though only via a custom I/O layer, not by opening a normal file.

Full Expert Developer Follow

Published on medium.com

The crash file is twenty-one bytes. Four of those bytes are 20 4b 50 56, the magic number that convinces FFmpeg it’s looking at a Sony PlayStation 2 audio container.

Full Expert Developer, on medium.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 missing check for zero channels before dividing, combined with a failed codec open overwriting the container's channel layout with an empty one.

Impact

The crash only occurs with a custom I/O layer, not when opening a normal file, and causes no memory corruption or code execution.

What the attacker needed

Custom I/O layer; crafted 21-byte file

The fix

A pull request added a guard in vpk.c, a structural fix in demux.c to avoid overwriting parameters when the codec fails to open, and a regression test; it was not yet merged.

How it was found

  1. Create a 21-byte file with the PS2 VPK magic number.
  2. Set the channel count field at offset 0x0e to zero.
  3. Feed the file to FFmpeg through a custom I/O layer that lets header and packet data disagree.
  4. The demuxer divides by zero and the process crashes with SIGFPE.

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 demuxer is the part of a media program that reads a file's container format. Here, a tiny file claimed to have zero audio channels, and the code divided a size by that zero, which crashes the program. The same flaw had been reported long before but was never fixed.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.