Zip Bomb
An archive attack that turns a small compressed input into excessive CPU, memory, disk, or recursive extraction work.
A ZIP bomb is an archive designed to produce excessive expansion in output size, execution time or resource consumption during extraction. A resource-bound extraction policy considers the entire operation rather than only the archive's compressed transport size.
Resource-bounded extraction
The policy defines independent limits for total expanded bytes, expanded bytes per entry, entry count, nested-archive depth, temporary storage and processing time. Expansion ratio can be expressed as expanded_size / compressed_size, but this ratio alone is not an execution budget. Tracking input and output counters throughout streaming extraction allows work to remain within defined bounds.
Archive entry paths are resolved relative to an extraction root. Parent-directory components, absolute paths and symbolic links are treated according to an explicit filesystem-path policy. When nested archives are processed, every nesting level consumes the same overall job budget. This preserves one consistent resource boundary for the entire input tree.
Processing architecture
Streaming decompression can update resource counters while entries are read and produced. Content inspection and filesystem extraction may be treated as separate phases, each recording consumed capacity and completed entries. In an ingestion pipeline, the approach combines naturally with bounded queues and per-job capacity management.