Skip to content

ajtazer/heckit / skills/cve-hunting/decompression-bomb

decompression-bomb

Verified

Detect decompression bomb vulnerabilities where compressed input can expand to exhaust memory, targeting buffer-based decompression without size limits.

FileKindSize
SKILL.mdskill md2.8 KB
references/false-positive-indicators.mdmarkdown959 B
references/poc-skeleton.mdmarkdown2.5 KB
references/sinks.mdmarkdown1.7 KB

references/sinks.md

View on GitHub
# Decompression Sinks by Language

## JavaScript / TypeScript

| Sink | Type | Risk |
|------|------|------|
| `zlib.gunzipSync(buf)` | Buffer | HIGH -- full output in memory |
| `zlib.inflateSync(buf)` | Buffer | HIGH |
| `zlib.brotliDecompressSync(buf)` | Buffer | HIGH |
| `zlib.gunzip(buf, callback)` | Buffer (async) | HIGH -- full output in callback |
| `zlib.createGunzip()` | Stream | MEDIUM -- check backpressure |
| `zlib.createInflate()` | Stream | MEDIUM |
| `pako.inflate(buf)` | Buffer | HIGH |
| `pako.ungzip(buf)` | Buffer | HIGH |
| `fflate.decompressSync(buf)` | Buffer | HIGH |
| `fflate.gunzipSync(buf)` | Buffer | HIGH |
| `lz-string.decompress(str)` | Buffer | HIGH |
| `snappy.uncompressSync(buf)` | Buffer | HIGH |

## Python

| Sink | Type | Risk |
|------|------|------|
| `zlib.decompress(data)` | Buffer | HIGH |
| `gzip.decompress(data)` | Buffer | HIGH |
| `bz2.decompress(data)` | Buffer | HIGH |
| `lzma.decompress(data)` | Buffer | HIGH |
| `gzip.open().read()` | Stream->Buffer | HIGH if read() called |
| `zipfile.read()` | Buffer | HIGH |
| `tarfile.extractfile().read()` | Stream->Buffer | HIGH |

### Python zlib with maxLength
```python
# SAFER -- limits output size
zlib.decompress(data, wbits=15, bufsize=MAX_SIZE)
# But bufsize is just initial allocation, not a hard limit!
# Use zlib.decompressobj() with incremental decompression for true limiting
```

## Go

| Sink | Type | Risk |
|------|------|------|
| `gzip.NewReader(r)` + `io.ReadAll()` | Stream->Buffer | HIGH |
| `zlib.NewReader(r)` + `io.ReadAll()` | Stream->Buffer | HIGH |
| `io.Copy(dst, gzipReader)` | Stream | MEDIUM -- depends on dst |
| `io.LimitReader(r, maxBytes)` | Stream | SAFE -- hard limit |
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall