{"id":"CVE-2026-113436","aliases":["CVE-2026-113436","EEF-CVE-2026-113436","GHSA-29cr-8477-rg6r"],"related":[],"kind":"vulnerability","state":"published","title":"Quadratic bignum parsing of Content-Length and Host port values in Bandit","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.\n\nBandit.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.\n\nThis issue affects bandit: from 1.0.0-pre.7 before 1.14.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.\n\nBandit.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.\n\nThis issue affects bandit: from 1.0.0-pre.7 before 1.14.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nInefficient 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.\n\n`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.\n\nThis issue affects bandit: from 1.0.0-pre.7 before 1.14.0.\n\n## Details\n\n**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.\n\n**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.\n\n**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.\n\n## Proof of concept\n\n1. Run Bandit with any Plug.\n2. Open an HTTP/2 connection with prior knowledge and complete the SETTINGS exchange.\n3. 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.\n4. The 124,003 bytes take 27.9 s to process before all 5,000 requests reach the Plug.\n\n## Impact\n\nAn 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.","format":"markdown","source":"eef"}],"published":"2026-10-26T13:31:35.033Z","modified":"2026-11-25T06:30:04.664Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"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","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"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","score":8.7,"rating":"HIGH"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-407"],"affected":[{"ranges":[{"type":"semver","introduced":"1.0.0-pre.7","fixed":"1.14.0","status":"affected"}],"vendor":"mtrudel","product":"bandit","package":"bandit","cpe":"cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*","repo":"https://github.com/mtrudel/bandit","source":"cvelist"},{"ranges":[{"type":"git","introduced":"e0c8c0c30af9b0f57d8aafac37ddd9294363a8be","fixed":"220b9dfd27f9a21305be2afc75cbe585ddc24e7a","status":"affected"}],"vendor":"mtrudel","product":"bandit","package":"mtrudel/bandit","cpe":"cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*","repo":"https://github.com/mtrudel/bandit","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.0.0-pre.7","status":"affected","fixed":"1.14.0"}],"ecosystem":"Hex","package":"bandit","purl":"pkg:hex/bandit","source":"eef"},{"ranges":[{"type":"git","introduced":"e0c8c0c30af9b0f57d8aafac37ddd9294363a8be","status":"affected","fixed":"220b9dfd27f9a21305be2afc75cbe585ddc24e7a"}],"repo":"https://github.com/mtrudel/bandit","source":"eef"}],"references":[{"url":"https://github.com/mtrudel/bandit/security/advisories/GHSA-29cr-8477-rg6r","tags":["advisory","related","vendor-advisory"],"sources":["cvelist","eef","nvd"]},{"url":"https://cna.erlef.org/cves/CVE-2026-113436.html","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-113436","tags":["related"],"sources":["cvelist","nvd"]},{"url":"https://github.com/mtrudel/bandit/commit/e0c8c0c30af9b0f57d8aafac37ddd9294363a8be","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/mtrudel/bandit/commit/220b9dfd27f9a21305be2afc75cbe585ddc24e7a","tags":["fix","patch"],"sources":["cvelist","eef","nvd"]},{"url":"https://hex.pm/packages/bandit","tags":["package"],"sources":["eef"]}],"credits":["Peter Ullrich","Jonatan Männchen / EEF","Mat Trudel"],"assigner":"EEF","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-10-26T15:12:04.626Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-113436","url":"https://www.cve.org/CVERecord?id=CVE-2026-113436","licence":"CVE Terms of Use","modified":"2026-11-19T08:08:02.987Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-113436","url":"https://osv.dev/vulnerability/EEF-CVE-2026-113436","licence":"CC-BY-4.0","modified":"2026-11-25T06:30:04.664Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-113436","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113436","licence":"Public domain","modified":"2026-10-26T16:59:16.113Z"}],"updatedAt":"2026-11-25T22:59:47.119Z","epss":{"score":0.00603,"percentile":0.50229,"date":"2026-12-01T12:00:22.000Z"}}