Skip to content
DoS Disclosed report Intermediate CVE-2022-32206

CVE-2022-32206: HTTP compression denial of service

curl allowed an unbounded number of chained HTTP compression algorithms in a server response, so a malicious server could send a response with a virtually unlimited number of compression steps. This could cause curl to allocate enormous amounts of heap memory or return out-of-memory errors, resulting in denial of service.

nyymi Follow

Originally disclosed on HackerOne

Bounty$2,400 Medium View original
  • Fixed in 13 hours
  • Paid in 13 hours
  • Disclosed after 13 hours

Summary by the program

CVE-2022-32206: HTTP compression denial of service Project curl Security Advisory, June 27th 2022

VULNERABILITY curl supports "chained" HTTP compression algorithms, meaning that a server response can be compressed multiple times and potentially with different algorithms. The number of acceptable "links" in this "decompression chain" was unbounded, allowing a malicious server to insert a virtually unlimited number of compression steps.

The use of such a decompression chain could result in a "malloc bomb", making curl end up spending enormous amounts of allocated heap memory, or trying to and returning out of memory errors.

We are not aware of any exploit of this flaw.

INFO CVE-2022-32206 was introduced in commit dbcced8e32b50c06, shipped in curl 7.57.0.

Automatic decompression of content needs to be enabled per transfer. It is disabled by default and then nothing bad happens.

This flaw exists with just one of the compression algorithms built-in (gzip, brotli or zstd), but the individual algorithms has different "exploding" powers.

Both Content-Encoding: and Transfer-Encoding: are affected. The vulnerability is more emphasized over HTTP/1 than HTTP/2 due to different curl internal header limits.

CWE-770: Allocation of Resources Without Limits or Throttling

Severity: Medium

AFFECTED VERSIONS Affected versions: curl 7.57.0 to and including 7.83.1 Not affected versions: curl < 7.57.0 and curl >= 7.84.0 libcurl is used by many applications, but not always advertised as such!

THE SOLUTION The amount of accepted "chained" algorithms is now capped to 5.

A fix for CVE-2022-32206

RECOMMENDATIONS A - Upgrade curl to version 7.84.0

B - Apply the patch to your local version

C - Do not enable automatic decompression

TIMELINE This issue was reported to the curl project on May 15, 2022. We contacted distros@ openwall on June 20.

libcurl 7.84.0 was released on June 27 2022, coordinated with the publication of this advisory.

CREDITS This issue was reported by Harry Sintonen. Patched by Daniel Stenberg.

Thanks a lot!

Security Advisory: https://curl.se/docs/CVE-2022-32206.html

The report

curl supports "chained" HTTP compression algorithms, meaning that a server response can be compressed multiple times and potentially with different algorithms. The number of acceptable "links" in this "decompression chain" was unbounded, allowing a malicious server to insert a virtually unlimited number of compression steps.

The use of such a decompression chain could result in a "malloc bomb", making curl end up spending enormous amounts of allocated heap memory, or trying to and returning out of memory errors.

Impact

Denial of service

The original report as published on HackerOne, by nyymi. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The number of chained compression algorithms accepted in a decompression chain was unbounded, so curl would allocate memory for each step without a cap.

Impact

A malicious server could cause curl to spend enormous amounts of heap memory or return out-of-memory errors, leading to denial of service; automatic decompression must be enabled per transfer, and the flaw is more emphasised over HTTP/1 than HTTP/2.

What the attacker needed

Automatic decompression enabled; malicious server response

The fix

The amount of accepted chained algorithms was capped to 5, and users should upgrade to curl 7.84.0 or apply the patch.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A malicious server could make curl use up large amounts of memory or return out-of-memory errors.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by nyymi

View all

51 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.