Benoitc hackney
Unbounded response body buffering and decompression in hackney
Allocation of Resources Without Limits or Throttling vulnerability in hackney_conn in benoitc hackney allows a malicious HTTP server to exhaust client memory via an oversized or highly compressed response body. hackney:request/5 and hackney:body/1 return the whole response body, and nothing bounds how much the connection process buffers. Any server the client requests can trigger it. hackney_conn:read_full_body/2 and the HTTP/2 and HTTP/3 accumulators append every chunk until the body ends. With {auto_decompress, true} the buffered body is then inflated in one step with zlib:gunzip/1 or zlib:inflate/2, which return the whole output at once. This issue affects hackney: from 2.0.0-beta.1 before 4.9.0.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 2.0.0-beta.1, < 4.9.0
Fixed in 4.9.0
- >= dc41b79339ca0c41e16d3f2dd17172bc2de855d6, < 493e8bf83a391548e5101792276ab3fc428fa76c
Fixed in 493e8bf83a391548e5101792276ab3fc428fa76c
Mitigation
Upgrade hackney to 4.9.0 or later.
Upgrade hackney to 493e8bf83a391548e5101792276ab3fc428fa76c or later.
Workaround
Leave auto_decompress disabled (the default). Without it hackney_conn:maybe_decompress_body/2 never inflates the body, which closes the amplification half. The uncapped raw body read has no workaround.
References
- Vendor advisory github.com/benoitc/hackney/releases/tag/4.9.0
- Patch github.com/benoitc/hackney/pull/980
- Patch github.com/benoitc/hackney/commit/dc41b79339ca…
1 more
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.