# Possible DoS Vulnerability with Range Header in Rack

Crafted Range header with many overlapping byte ranges made Rack return a response far larger than the file, exhausting server memory and causing DoS.

- Payout: $5,420
- Severity: high
- Program: Internet Bug Bounty
- Found by: ooooooo_q
- Disclosed: 2024-09-25
- CVE: CVE-2024-26141
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/2520679
- Library page: https://bugbountylibrary.com/r/h1%3A2520679
- Tags: area:web domain:web impact:dos impact:internal-access kind:bounty platform:hackerone sev:high tech:ruby technique:source-review vuln:dos

**Target:** Rack::Utils.get_byte_ranges / Rack::Files / Rails Active Storage proxy controller
**Root cause:** get_byte_ranges caps each range to file size but does not limit the number or overlap of ranges, so a header with thousands of ranges produces a response body many times the file size.
**Steps:**
1. Set up Rails 7.1.2 with Active Storage and a model with an attachment; upload a file and copy the proxy URL `/rails/active_storage/blobs/proxy/...`.
2. Build a Range header of `bytes=` followed by `-999999999,` repeated ~7446 times to fit within the 80KB header limit of puma/unicorn.
3. Send `GET` to the proxy URL with that Range header via Net::HTTP.
4. Observe `206 Partial Content` with body size ~410MB for a ~50KB file; repeat to exhaust memory.
**How found:** Researcher read the Active Storage proxy controller and streaming concern, traced to Rack::Utils.get_byte_ranges, and noticed the returned ranges are bounded by file size individually but not in count or overlap, then tested with a crafted multi-range header.
**Exploitation:** Attacker uploads or references a file, then repeatedly sends GET requests with a Range header containing thousands of overlapping `-999999999,` ranges. Each request causes the server to buffer a response hundreds of MB to multiple GB in size, exhausting memory. Even aborting the request mid-stream doesn't stop server-side preparation, amplifying the attack.
**Insight:** When auditing Range/partial-content handling, check whether the parser bounds the number and overlap of ranges, not just each range's endpoints; multi-range responses can amplify a tiny file into a huge body.

