Low severityNVD Advisory· Published Feb 28, 2024· Updated Feb 13, 2025
Possible DoS Vulnerability with Range Header in Rack
CVE-2024-26141
Description
Rack is a modular Ruby web server interface. Carefully crafted Range headers can cause a server to respond with an unexpectedly large response. Responding with such large responses could lead to a denial of service issue. Vulnerable applications will use the Rack::File middleware or the Rack::Utils.byte_ranges methods (this includes Rails applications). The vulnerability is fixed in 3.0.9.1 and 2.2.8.1.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
rackRubyGems | >= 3.0.0, < 3.0.9.1 | 3.0.9.1 |
rackRubyGems | >= 1.3.0, < 2.2.8.1 | 2.2.8.1 |
Affected products
1Patches
262457686b26dReturn an empty array when ranges are too large
2 files changed · +7 −0
lib/rack/utils.rb+3 −0 modified@@ -380,6 +380,9 @@ def get_byte_ranges(http_range, size) end ranges << (r0..r1) if r0 <= r1 end + + return [] if ranges.map(&:size).sum > size + ranges end
test/spec_utils.rb+4 −0 modified@@ -590,6 +590,10 @@ def initialize(*) end describe Rack::Utils, "byte_range" do + it "returns an empty list if the sum of the ranges is too large" do + assert_equal [], Rack::Utils.byte_ranges({ "HTTP_RANGE" => "bytes=0-20,0-500" }, 500) + end + it "ignore missing or syntactically invalid byte ranges" do Rack::Utils.byte_ranges({}, 500).must_be_nil Rack::Utils.byte_ranges({ "HTTP_RANGE" => "foobar" }, 500).must_be_nil
4849132bef47Return an empty array when ranges are too large
2 files changed · +7 −0
lib/rack/utils.rb+3 −0 modified@@ -459,6 +459,9 @@ def get_byte_ranges(http_range, size) end ranges << (r0..r1) if r0 <= r1 end + + return [] if ranges.map(&:size).sum > size + ranges end
test/spec_utils.rb+4 −0 modified@@ -716,6 +716,10 @@ def initialize(*) end describe Rack::Utils, "get_byte_ranges" do + it "returns an empty list if the sum of the ranges is too large" do + assert_equal [], Rack::Utils.byte_ranges({ "HTTP_RANGE" => "bytes=0-20,0-500" }, 500) + end + deprecated "pase simple byte ranges from env" do Rack::Utils.byte_ranges({ "HTTP_RANGE" => "bytes=123-456" }, 500).must_equal [(123..456)] end
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
9- github.com/advisories/GHSA-xj5v-6v4g-jfw6ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-26141ghsaADVISORY
- discuss.rubyonrails.org/t/possible-dos-vulnerability-with-range-header-in-rack/84944ghsax_refsource_MISCWEB
- github.com/rack/rack/commit/4849132bef471adb21131980df745f4bb84de2d9ghsax_refsource_MISCWEB
- github.com/rack/rack/commit/62457686b26d33a15a254c7768c2076e8e02b48bghsax_refsource_MISCWEB
- github.com/rack/rack/security/advisories/GHSA-xj5v-6v4g-jfw6ghsax_refsource_CONFIRMWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2024-26141.ymlghsax_refsource_MISCWEB
- lists.debian.org/debian-lts-announce/2024/04/msg00022.htmlmitre
- security.netapp.com/advisory/ntap-20240510-0007/mitre
News mentions
0No linked articles in our index yet.