Vulnerability description

Uncontrolled Resource Consumption vulnerability in ninenines cowlib (cow_http_te module) allows Excessive Allocation.

The chunked transfer-encoding parser in cow_http_te accepts an unbounded number of hex digits in the chunk-size field. Each digit causes a bignum multiplication (Len * 16 + digit), so parsing N hex digits requires O(N²) CPU work and O(N) memory. Additionally, when input is drip-fed, the parser discards the accumulated length on each partial read and restarts from zero on resumption, raising the cost to O(N³). An unauthenticated remote attacker can exploit this by sending an HTTP/1.1 request with Transfer-Encoding: chunked and a very long chunk-size hex string to cause denial of service through CPU exhaustion and memory amplification.

This vulnerability is associated with program file src/cow_http_te.erl and program routines cow_http_te:stream_chunked/2, cow_http_te:chunked_len/4.

This issue affects cowlib: from 0.6.0 before 2.16.1.

Affected

pkg:hex/cowlib

Module Source File Routine
cow_http_te src/cow_http_te.erl cow_http_te:stream_chunked/2
cow_http_te:chunked_len/4
Status Type Version Changes / Fixed in
affected semver 0.6.0 < 2.16.1

pkg:github/ninenines/cowlib

Module Source File Routine
cow_http_te src/cow_http_te.erl cow_http_te:stream_chunked/2
cow_http_te:chunked_len/4
Status Type Version Changes / Fixed in
affected git 8c0e428b01 < a4b8039ce8

Workarounds

In Cowboy, setting initial_stream_flow_size to a much lower value limits the amount of chunked body data that cowlib will parse in a single read, reducing the window of data an attacker can use to trigger the quadratic work. This does not fully eliminate the vulnerability but can significantly reduce its impact for some applications.

References

Credits

  • Finder: Peter Ullrich
  • Remediation developer: Loïc Hoguin

CVE record as JSON:  GET /cves/CVE-2026-7790.json
OSV record as JSON:  GET /osv/EEF-CVE-2026-7790.json