# CVE-2022-32206: HTTP compression denial of service

curl accepted unbounded chained Content-Encoding/Transfer-Encoding compression links, letting a malicious server trigger a malloc bomb and OOM denial of service.

- Payout: $2,400
- Severity: medium
- Program: Internet Bug Bounty
- Found by: nyymi
- Disclosed: 2022-06-27
- CVE: CVE-2022-32206
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1614330
- Library page: https://bugbountylibrary.com/r/h1%3A1614330
- Tags: area:oss domain:oss impact:dos kind:bounty platform:hackerone sev:medium tech:curl technique:source-review vuln:dos

**Target:** curl/libcurl HTTP decompression (Content-Encoding and Transfer-Encoding chained algorithms)
**Root cause:** The number of links in the decompression chain was unbounded, so a server could specify arbitrarily many stacked compression steps, each allocating heap memory.
**Steps:**
1. Enable automatic decompression in curl (e.g. `curl --compressed`).
2. Point curl at a malicious server that returns a response with a Content-Encoding (or Transfer-Encoding) header listing a very large number of chained compression algorithms.
3. curl allocates memory per decompression link, exhausting heap / returning out-of-memory errors.
**Exploitation:** A malicious or compromised server responds to a client using automatic decompression with a header chaining a virtually unlimited number of compression algorithms, causing curl to allocate enormous heap memory (malloc bomb) and fail with OOM, denying service. Requires automatic decompression enabled per transfer (disabled by default).
**Insight:** Chained/stacked content-encoding is a resource-exhaustion surface: any client that auto-decompresses should cap the number of encoding links, and testers should try absurdly long Content-Encoding/Transfer-Encoding chains against clients with auto-decompress enabled.

