Skip to content
DoS Write-up Intermediate

$500 Bounty: Excessive Memory Usage in Messenger and Facebook App When Rendering Invalid GIFs

Malformed GIF files with unusual parameters such as a zero frame delay, infinite looping and injected zero-size frames caused the Messenger and Facebook apps to consume excessive memory and crash with out-of-memory errors. An attacker could send such a crafted GIF to a victim to crash the app.

muriarfad Follow

Published on medium.com

This write-up details a vulnerability discovered in the Messenger and Facebook applications, where rendering malformed GIF files led to excessive memory consumption, culminating in app crashes due to Out-of-Memory (OOM) errors.

Sancyty, 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 the GIF decoder did not validate or bound frame dimensions and timing values, so crafted frames with zero width and height and a zero delay caused unbounded memory allocation.

Impact

A crafted GIF could cause the Messenger and Facebook apps to exhaust memory and crash, disrupting the victim's use of the app.

What the attacker needed

Victim opens or receives the crafted GIF; attacker can send a file to the victim

How it was found

  1. Study the GIF file format and how decoders such as FFmpeg process its blocks.
  2. Write a script that builds GIF files byte by byte with controllable frame delay, frame size and interlaced flag.
  3. Inject frames with zero width and height at regular intervals and set the frame delay to zero.
  4. Send the crafted GIF through Messenger or the Facebook app and observe memory use and crashes.

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 GIF is an image file that can hold several pictures shown in sequence, like a tiny animation. The apps that display these files did not cope well with a deliberately odd GIF, so they kept using more and more memory until the phone ran out and the app shut down. This is a denial-of-service issue: the goal is to break the app for the person using it, not to steal data.

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.