Skip to content
DoS Write-up Intermediate

A 65,529-Sample Lie: How a Tiny TIFF Fooled GDAL Into Asking for 16 GB

A tiny TIFF file with an abnormal SamplesPerPixel metadata value caused GDAL's GTiff driver to request a 16.4 GB memory allocation, leading to a processing failure and denial of service. The issue was fixed upstream with a codec-aware check on realistic compression ratios.

aleens09 Follow

Published on medium.com

Three kilobytes. That is all it took.

Aleens-labs, 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 GTiff driver calculated an uncompressed buffer size from attacker-controlled SamplesPerPixel metadata without checking whether the claimed compressed-to-uncompressed ratio was realistic for the active codec.

Impact

A service that automatically processes attacker-controlled TIFF files through GDAL could suffer job failure, worker termination under memory limits, or repeated resource exhaustion; no confidentiality, integrity, or code-execution impact was demonstrated.

What the attacker needed

Attacker-controlled TIFF input; application processes TIFFs via GDAL

The fix

The final fix was merged into GDAL's internal libtiff, adding a codec-aware maximum compression ratio check so implausibly large decoded sizes are rejected before allocation.

How it was found

  1. Create a small TIFF file with an abnormal SamplesPerPixel value.
  2. Run gdal_translate on the file to convert it.
  3. Observe the error reporting a failed allocation of about 16.4 GB.

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 TIFF image file stores metadata that tells the decoder how big the image is. By setting one metadata field to an absurdly high number, a tiny file made the decoder try to reserve a huge amount of memory, which failed and stopped the conversion. This is a denial-of-service bug: the attacker does not steal data, they just make the program waste resources.

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 aleens09

View all

3 more disclosed reports, best first.

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.