What is a Decompression Bomb?

A decompression bomb is an input whose expanded or decoded representation consumes excessive resources relative to its encoded size. Compressed archives and images can both exhaust storage, memory, or processing time during decoding.

How Decompression Bombs work

A small ZIP can expand into a very large collection of files, while a compact image can declare enough pixels to require a huge decode buffer. The expensive work happens before ordinary downstream processing can inspect the finished result. Bound resource use in the decoder or sandbox itself, count actual expanded data, and stop work when a budget is exceeded. Advertised sizes are useful screening information but remain untrusted input.

Key facts

  1. A ZIP bomb is one kind of decompression bomb. Nested archives add recursion risks, but a malicious input does not need nesting to be expensive.
  2. Antivirus checks and file-type detection do not replace memory, time, and expansion limits. Each control addresses a different failure mode.
  3. Archive extraction also needs path validation to prevent writes outside the destination directory. That traversal issue is distinct from excessive expansion.

When Decompression Bombs matter

Enforce limits on expanded bytes, decoded dimensions, archive entries, recursion, and execution time. Checking only the incoming file’s compressed byte size leaves the expensive representation unbounded.

Sources

Turn media knowledge into a working pipeline

Connect uploads, processing, AI, storage, and delivery through one declarative API — with the encoding stack, scaling, and format churn handled for you.

Try Transloadit for free