Apache Avro C β deflate decompression-bomb PoC (coordinated disclosure)
This repository contains security-research proof-of-concept files, not a machine-learning
model. The .avro files here are crafted inputs that demonstrate a denial-of-service
vulnerability (unbounded deflate decompression β memory exhaustion) in the Apache Avro C
library's decode_deflate() (lang/c/src/codec.c). They are published solely to let the
huntr triage team and the Apache Avro maintainers reproduce the issue
during coordinated disclosure.
- Impact: availability only (memory-exhaustion DoS). These files do not execute code, exfiltrate data, or persist anything β parsing one causes the reader process to allocate memory proportional to the decompressed size and, on a memory-limited host, be OOM-killed.
- Affected: Apache Avro C library β€ 1.12.1 and current
main, with the (default) deflate codec enabled. - Not affected by anything you run locally beyond your own Avro reader β the payload is inert unless deliberately fed to a vulnerable Avro C reader.
Files
| File | Compressed size | Decompresses to | Purpose |
|---|---|---|---|
poc_deflate_bomb_500m.avro |
~510 KB | ~500 MB | primary PoC (drives ~514 MB RSS) |
poc_deflate_bomb_16k.avro |
~16 KB | ~16 MB | smaller demo / quick check |
Both are valid Avro object-container files: "Obj\x01" magic, a metadata map declaring
avro.codec = deflate and a trivial avro.schema, a sync marker, then one data block whose
deflate stream is a ~1000:1 bomb.
Reproduce
# Build the stock reader from a clean release (no sanitizers):
git clone https://github.com/apache/avro && cd avro && git checkout release-1.12.1
cd lang/c && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release .. && make -j"$(nproc)" avrocat
# Load the PoC file with the unmodified reader and watch peak RSS:
/usr/bin/time -v ./src/avrocat /path/to/poc_deflate_bomb_500m.avro >/dev/null
# -> "Maximum resident set size": ~514000 kbytes for a 510 KB input.
A 510 KB file drives ~514 MB of resident memory in the unmodified file reader (1029Γ).
Amplification is bounded only by available memory; a larger block or a multi-block file
drives the reader to OOM.
Root cause
decode_deflate() grows its output buffer with an unbounded doubling loop
(codec.c:340-347) β no cap on decompressed size and no NULL-check on the realloc. The
declared block size in the container is never validated against the decompressed size.
Responsible use
These files are provided for verification of a reported vulnerability under coordinated disclosure. Do not deploy them against systems you do not own or operate. They will be removed after the report is triaged and a fix is available.