MediumGHSA-22f2-v57c-j9cxCVE-2024-25126
Rack vulnerable to ReDoS in content type parsing (2nd degree polynomial)
Published 28 Feb 2024 · Updated 10 Sept 2026
Is your project on an affected rack?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
rackRubyGems
- Affected
- >=3.0.0 <3.0.9.1
- Fixed in
- 3.0.9.1
Update to the fixed version for your release line, for example:
bundle update --conservative rack # Gemfile: '>= 3.0.9.1'rackRubyGems
- Affected
- >=0.4 <2.2.8.1
- Fixed in
- 2.2.8.1
Update to the fixed version for your release line, for example:
bundle update --conservative rack # Gemfile: '>= 2.2.8.1'Details
Summary
module Rack
class MediaType
SPLIT_PATTERN = %r{\s*[;,]\s*}The above regexp is subject to ReDos. 50K blank characters as a prefix to the header will take over 10s to split.
PoC
A simple HTTP request with lots of blank characters in the content-type header:
request["Content-Type"] = (" " * 50_000) + "a,"Impact
It's a very easy to craft ReDoS. Like all ReDoS the impact is debatable.
Is GHSA-22f2-v57c-j9cx in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected rack, and gives you the command that fixes it.
More advisories for rack
- HighCVE-2026-125111Rack: Multipart parsing allows DoS via unbounded scan buffer growth · 10 Nov 2026
- LowCVE-2026-125108Rack: Multipart boundary ambiguity guard in Rack::Multipart::Parser can be bypassed with a quoted boundary value, allowing WAF bypass · 10 Nov 2026
- MediumCVE-2026-125109Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835 · 10 Nov 2026
- MediumCVE-2026-125110Rack: Rack::Static header_rules bypass via dot-segment normalization mismatch · 10 Nov 2026
- MediumCVE-2026-34835Rack::Request accepts invalid Host characters, enabling host allowlist bypass · 2 Apr 2026
- MediumCVE-2026-34831Rack has Content-Length mismatch in Rack::Files error responses · 2 Apr 2026
References
- Linkgithub.com/rack/rack/security/advisories/GHSA-22f2-v57c-j9cx
- Advisorynvd.nist.gov/vuln/detail/CVE-2024-25126
- Linkgithub.com/rack/rack/commit/6efb2ceea003c4b195815a614e00438cbd543462
- Linkgithub.com/rack/rack/commit/d9c163a443b8cadf4711d84bd2c58cb9ef89cf49
- Linkdiscuss.rubyonrails.org/t/denial-of-service-vulnerability-in-rack-content-type-parsing/84941
- Packagegithub.com/rack/rack
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2024-25126.yml
- Linklists.debian.org/debian-lts-announce/2024/04/msg00022.html
- Linksecurity.netapp.com/advisory/ntap-20240510-0005
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.