Banditに大量の桁数を持つ値で処理を遅延させる脆弱性、CPUを消費される
Summary
Banditの1.0.0-pre.7から1.14.0より前のバージョンに、ヘッダー内の数値を解析する処理の脆弱性が見つかりました。認証なしの遠隔の攻撃者が、数千桁の content-length や Host の値を送ることでサーバーのCPUを使い切らせる可能性があります。修正版はHexの1.14.0です。利用中の版を確認し、1.14.0以降へ更新してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
Banditの1.0.0-pre.7から1.14.0より前のバージョンに、ヘッダー内の数値を解析する処理の脆弱性が見つかりました。認証なしの遠隔の攻撃者が、数千桁の content-length や Host の値を送ることでサーバーのCPUを使い切らせる可能性があります。修正版はHexの1.14.0です。利用中の版を確認し、1.14.0以降へ更新してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| mtrudelbandit |
≥ e0c8c0c30af9b0f57d8aafac37ddd9294363a8be, < 220b9dfd27f9a21305be2afc75cbe585ddc24e7a→ 220b9dfd27f9a21305be2afc75cbe585ddc24e7a |
220b9dfd27f9a21305be2afc75cbe585ddc24e7a |
| Hexbandit |
≥ 1.0.0-pre.7, < 1.14.0→ 1.14.0 |
1.14.0 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- Ubuntu UBUNTU-CVE-2026-113436 bandit No fixed version in this record
Original description The description as published by the source.
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.
**…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- package hex.pm
- package github.com
- patch github.com
- web cna.erlef.org
- web osv.dev
- web github.com
- web github.com
- web repo.hex.pm