Skip to content
Back to skills

Decompression Bomb

ASecurity

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

  • 46 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 26, 2026
securityjavascriptpythongojavabash

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add ByamB4/find-cve-agent --skill decompression-bomb --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Decompression Bomb?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Decompression Bomb
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/byamb4-decompression-bomb/badge)](https://www.skillsdirectory.com/skills/byamb4-decompression-bomb)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: decompression-bomb
description: "Detect decompression bomb vulnerabilities where compressed input can expand to exhaust memory, targeting buffer-based decompression without size limits."
metadata:
  filePattern:
    - "**/*.js"
    - "**/*.ts"
    - "**/*.py"
    - "**/*.go"
  bashPattern:
    - "grep.*(zlib|gzip|deflate|decompress|inflate|gunzip)"
  priority: 78
---

# Decompression Bomb Detection

## When to Use

Audit archive/compression libraries, file upload handlers, content-encoding processors, and any package that decompresses user-supplied data.

## Key Insight

**Buffer-based decompression is vulnerable**: the entire decompressed output is loaded into memory at once. A 1KB compressed payload can expand to 1GB+.

**Stream-based MAY have backpressure**: but only if the consumer applies it. Many stream implementations still buffer the entire output.

## Process

### Step 1: Find Decompression Sinks

```
# JavaScript
grep -rn "zlib\.gunzip\|zlib\.inflate\|zlib\.unzip\|zlib\.brotli" .
grep -rn "gunzipSync\|inflateSync\|unzipSync\|brotliDecompress" .
grep -rn "pako\|fflate\|lz-string\|snappy" .
grep -rn "decompress\|decompressSync\|uncompress" .

# Python
grep -rn "zlib\.decompress\|gzip\.decompress\|bz2\.decompress" .
grep -rn "lzma\.decompress\|snappy\.decompress" .

# Go
grep -rn "gzip\.NewReader\|zlib\.NewReader\|flate\.NewReader" .
grep -rn "compress/gzip\|compress/zlib\|compress/flate" .
```

### Step 2: Check for Size Limits

```
grep -rn "maxSize\|maxOutput\|maxLength\|MAX_SIZE\|outputLimit\|sizeLimit" .
grep -rn "ratio\|compressionRatio\|maxRatio" .
```

### Step 3: Check Buffer vs Stream

Buffer-based (VULNERABLE):
```js
zlib.gunzipSync(input)                    // Entire output in memory
zlib.gunzip(input, (err, result) => {})   // Callback with full buffer
```

Stream-based (CHECK):
```js
input.pipe(zlib.createGunzip()).pipe(output)  // Streaming, may have backpressure
```

Even stream-based can be vulnerable if:
- Output is collected into a buffer: `const chunks = []; stream.on('data', c => chunks.push(c))`
- No backpressure is applied
- Consumer reads faster than it can process

### Step 4: Verify Exploitability

1. Can the attacker supply compressed data? (file upload, HTTP content-encoding, archive processing)
2. Is there an input size limit that would prevent the bomb?
3. Is there a decompressed size limit?
4. Is the process memory-limited?

## CVSS Guidance

- Unauthenticated OOM crash: HIGH 7.5
- Authenticated OOM crash: MEDIUM 6.5
- Stream-based with memory growth: MEDIUM 5.3
- With input size limits that bound expansion: may not be exploitable

## References

- [Sinks](references/sinks.md) -- Decompression sinks by language
- [False Positive Indicators](references/false-positive-indicators.md)
- [PoC Skeleton](references/poc-skeleton.md)

Files in this skill

  • SKILL.md2.8 KB
  • references/false-positive-indicators.md959 B
  • references/poc-skeleton.md2.5 KB
  • references/sinks.md1.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.