|
| 1 | +--- |
| 2 | +gem: rack |
| 3 | +cve: 2026-34826 |
| 4 | +ghsa: x8cg-fq8g-mxfx |
| 5 | +url: https://github.com/rack/rack/security/advisories/GHSA-x8cg-fq8g-mxfx |
| 6 | +title: Rack's multipart byte range processing allows |
| 7 | + denial of service via excessive overlapping ranges |
| 8 | +date: 2026-04-02 |
| 9 | +description: | |
| 10 | + ## Summary |
| 11 | +
|
| 12 | + `Rack::Utils.get_byte_ranges` parses the HTTP `Range` header without |
| 13 | + limiting the number of individual byte ranges. Although the existing |
| 14 | + fix for CVE-2024-26141 rejects ranges whose total byte coverage |
| 15 | + exceeds the file size, it does not restrict the count of ranges. |
| 16 | + An attacker can supply many small overlapping ranges such as |
| 17 | + `0-0,0-0,0-0,...` to trigger disproportionate CPU, memory, I/O, |
| 18 | + and bandwidth consumption per request. |
| 19 | +
|
| 20 | + This results in a denial of service condition in Rack file-serving |
| 21 | + paths that process multipart byte range responses. |
| 22 | +
|
| 23 | + ## Details |
| 24 | +
|
| 25 | + `Rack::Utils.get_byte_ranges` accepts a comma-separated list of byte |
| 26 | + ranges and validates them based on their aggregate size, but does |
| 27 | + not impose a limit on how many individual ranges may be supplied. |
| 28 | +
|
| 29 | + As a result, a request such as: |
| 30 | +
|
| 31 | + ```http |
| 32 | + Range: bytes=0-0,0-0,0-0,0-0,... |
| 33 | + ``` |
| 34 | +
|
| 35 | + can contain thousands of overlapping one-byte ranges while still |
| 36 | + satisfying the total-size check added for CVE-2024-26141. |
| 37 | +
|
| 38 | + When such a header is processed by Rack’s file-serving code, each |
| 39 | + range causes additional work, including multipart response generation, |
| 40 | + per-range iteration, file seek and read operations, and temporary |
| 41 | + string allocation for response size calculation and output. This |
| 42 | + allows a relatively small request header to trigger disproportionately |
| 43 | + expensive processing and a much larger multipart response. |
| 44 | +
|
| 45 | + The issue is distinct from CVE-2024-26141. That fix prevents range |
| 46 | + sets whose total byte coverage exceeds the file size, but does not |
| 47 | + prevent a large number of overlapping ranges whose summed size |
| 48 | + remains within that limit. |
| 49 | +
|
| 50 | + ## Impact |
| 51 | +
|
| 52 | + Applications that expose file-serving paths with byte range support |
| 53 | + may be vulnerable to denial of service. |
| 54 | +
|
| 55 | + An unauthenticated attacker can send crafted `Range` headers containing |
| 56 | + many small overlapping ranges to consume excessive CPU time, memory, |
| 57 | + file I/O, and bandwidth. Repeated requests may reduce application |
| 58 | + availability and increase pressure on workers and garbage collection. |
| 59 | +
|
| 60 | + ## Mitigation |
| 61 | +
|
| 62 | + * Update to a patched version of Rack that limits the number |
| 63 | + of accepted byte ranges. |
| 64 | + * Reject or normalize multipart byte range requests containing |
| 65 | + excessive range counts. |
| 66 | + * Consider disabling multipart range support where it is not required. |
| 67 | + * Apply request filtering or header restrictions at the reverse |
| 68 | + proxy or application boundary to limit abusive `Range` headers. |
| 69 | +cvss_v3: 5.3 |
| 70 | +patched_versions: |
| 71 | + - "~> 2.2.23" |
| 72 | + - "~> 3.1.21" |
| 73 | + - ">= 3.2.6" |
| 74 | +related: |
| 75 | + url: |
| 76 | + - https://nvd.nist.gov/vuln/detail/CVE-2026-34826 |
| 77 | + - https://github.com/rack/rack/security/advisories/GHSA-x8cg-fq8g-mxfx |
| 78 | + - https://github.com/advisories/GHSA-x8cg-fq8g-mxfx |
0 commit comments