Skip to content
DoS Disclosed report Intermediate

PNG compression DoS

A PNG file with a zTXt chunk containing highly compressed data caused a denial of service when processed by the service, likely due to image processing tools attempting to decompress it. An attacker could send such a file to make the service time out.

spipm Follow

Originally disclosed on HackerOne

Bounty$500 View original
  • Triaged in 30 hours
  • Fixed in 6 months
  • Paid in 6 months
  • Disclosed after 18 months

PNG compression DoS

Because I did JPEG and GIF I just had to check out the PNG format.

Found

A PNG file is composed of multiple chunks. One of the optional ancillary chunks is called zTXT (ztxt). This chunk allows storage of compressed text data using the zlib library. From the zlib tech details: "The test case was a 50MB file filled with zeros; it compressed to roughly 49 KB" I used this to store a huge amount of data in a small PNG (smaller than 1 MB). When sent to HackerOne the service timed out. I think it's because Paperclip tried to identify and convert my image again.

As a attachment I sent the Python code I made to create the PNG, and the PNG itself. Usage: python createpng.py filename

Fixes

For an easy fix every PNG file with the string "zTXt" in it should be rejected. Other data chunks may be exploitable, but I haven't looked into them yet. When this bug is fixed I will continue my research.

Theory

Make sure your zlib library is updated . Because of old exploits in zlib's inflate() (zlibvuln1, zlibvuln2), attackers might make a PNG that can exploit old machines.

Attachments

The original report as published on HackerOne, by spipm. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 Paperclip's identify/convert processing decompresses the zTXt data, causing the timeout.

Impact

The service could time out, causing a denial of service for that request.

What the attacker needed

Ability to upload a PNG file

The fix

The report suggests rejecting PNG files containing the string "zTXt" as an easy fix, though other chunks may also be exploitable.

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.

PNG files can contain optional text chunks that store compressed data. If a service automatically processes images, it may try to decompress this data, and a small file can expand to a huge size, overwhelming the service. This is a denial-of-service attack because it makes the service unavailable.

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 by spipm

View all

6 more disclosed reports, best first.

More from HackerOne

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.