Skip to content
DoS Write-up Intermediate

Hacking YouTube With MP4

A crafted MP4 file with a mismatched timeScale in its header could claim a very long duration while being small in size. Uploading it to YouTube caused the transcoding pipeline to attempt to generate a huge output, potentially exhausting resources.

Florian Mathieu Follow

Published on realkeyboardwarrior.github.io

I accidentally discovered a potential vulnerability in YouTube during a late night debugging session on a MP4 muxer. This is a story how a simple bug in my own code made me rethink the security implications of a video transcoding pipeline.

Florian Mathieu, on realkeyboardwarrior.github.io

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 the video processing pipeline trusted the duration metadata in the MP4 header instead of deriving the duration from the actual video frames, and then transcoded to constant frame rate, inflating the output size.

Impact

The impact was low because YouTube's transcoders eventually give up on files that take too many resources, so the video remained stuck in processing rather than causing a full denial of service.

What the attacker needed

Ability to upload a video to YouTube; crafted MP4 file with false duration metadata

The fix

The duration of a video should be validated by deriving it from the real video frames rather than relying on the metadata.

How it was found

  1. Create an MP4 file with a mismatched timeScale in the header and presentation timestamps.
  2. Upload the file to YouTube.
  3. Observe that the thumbnail service attempts to generate thumbnails and the video remains in processing.
  4. After a few days, receive an error message that the video is too long.

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 muxer is software that combines audio and video into a single file. The researcher found that by lying about the video's duration in the file's header, a small file could make YouTube's processing system work very hard and produce a huge output, which could be a denial-of-service attack.

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.

More from Google

View all

The newest disclosed reports for this program.

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.