Skip to content

EEF-CVE-2026-113436 CVE-2026-113436 GHSA-29cr-8477-rg6r

Quadratic bignum parsing of Content-Length and Host port values in Bandit

Not rated yet Hex
Severity
0.0 / 10
Unknown · CVSS 4.0
Exploit chance (EPSS)
0.60%
Chance of exploitation in the next 30 days. Higher than 48.83% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-407 Inefficient Algorithmic Complexity
Fix
1.14.0
Upgrade bandit to this version or later

Description

Summary

Inefficient Algorithmic Complexity vulnerability in the header integer parser of mtrudel bandit allows an unauthenticated remote attacker to consume server CPU via a content-length value or a Host or :authority port made of thousands of digits.

Bandit.Headers.parse_integer/2 in lib/bandit/headers.ex builds the number one digit at a time with no limit on the digit count, allocating a new bignum at each step, so one value costs time quadratic in its length. It runs on raw request input over HTTP/1 and HTTP/2, before any range check. Over HTTP/2, a 4,000-digit value can be stored once in the HPACK dynamic table and re-sent on each new stream for about one byte: 124 KB of traffic kept the server busy for 27.9 s.

This issue affects bandit: from 1.0.0-pre.7 before 1.14.0.

Details

1. Unbounded digit loop. Bandit.Headers.parse_integer/2 in lib/bandit/headers.ex builds the number with total * 10 + digit - ?0 and has no limit on the digit count. Each step allocates a new bignum, so parsing one value costs O(n²). On OTP 28, 10,000 digits take about 10 ms, 50,000 about 250 ms and 80,000 about 560 ms, where String.to_integer/1 handles the same inputs in 1 to 3 ms.

2. Reached on raw input. It is called from get_content_length/1 and parse_hostlike_header!/1 on raw request input, before any range check. An all-digit content-length is returned as {:ok, huge_int}, and the is_port_number guard only runs after the whole number is built.

3. HPACK amplification. Over HTTP/2, a 4,000-digit value (about 1.1 ms to parse) can be stored once in the HPACK dynamic table and then re-sent on each new stream for about one byte.

Proof of concept

  1. Run Bandit with any Plug.
  2. Open an HTTP/2 connection with prior knowledge and complete the SETTINGS exchange.
  3. In one write, send 5,000 HEADERS frames for POST / on new streams, each carrying a content-length of 4,000 9 digits encoded with HPACK indexing, so that every frame after the first refers to the stored value.
  4. The 124,003 bytes take 27.9 s to process before all 5,000 requests reach the Plug.

Impact

An unauthenticated client can make the server spend CPU time out of all proportion to the traffic it sends (27.9 s for 124 KB in the reporter's test). This affects any Bandit server reachable by untrusted clients over HTTP/1 or HTTP/2, with no special configuration.

Affected versions

Hex

PackageVulnerableFixed in
bandit
>= 1.0.0-pre.7, < 1.14.0
1.14.0

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

bandit Hex → 1.14.0

mix
{:bandit, "~> 1.14.0"} # then: mix deps.update bandit

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Attack vector
Network
Attack complexity
Low
Attack requirements
None
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
None
Availability (vulnerable system)
High
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

Weakness

CWE-407: Inefficient Algorithmic Complexity

An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
EEF-CVE-2026-116078
HTTP/2 request bodies made of 1-byte DATA frames amplify memory use in Bandit
Not rated yet Also affects bandit
EEF-CVE-2026-108529
SETTINGS and stream-0 WINDOW_UPDATE frames trigger quadratic work over blocked streams in Bandit
Not rated yet Also affects bandit
EEF-CVE-2026-110499
Client-chosen HPACK encoder table size is applied uncapped, growing per-connection state with every response in Bandit
Not rated yet Also affects bandit
EEF-CVE-2026-109584
HTTP/2 cookie crumb join expands a small HPACK header block into an unbounded allocation in Bandit
Not rated yet Also affects bandit
EEF-CVE-2026-111103
HTTP/2 StreamError recovery rolls back connection state and bypasses per-connection limits in Bandit
Not rated yet Also affects bandit
EEF-CVE-2026-111101
HTTP/1.1 chunked request bodies made of 1-byte chunks amplify memory use in Bandit
Not rated yet Also affects bandit
EEF-CVE-2026-110314
WebSocket frames keep reaching the WebSock after a server-initiated close in Bandit
Not rated yet Also affects bandit
EEF-CVE-2026-114213
WebSocket 1-byte continuation frames bypass `max_fragmented_message_size` in Bandit
Not rated yet Also affects bandit

Credits: Jonatan Männchen / EEF, Mat Trudel, Peter Ullrich

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor