NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · RubyGems

CVE-2024-25126: Rack vulnerable to ReDoS in content type parsing (2nd degree polynomial)

mediumCVSS 3.1 5.3GHSA-22f2-v57c-j9cx

Summary 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: Impact It's a very easy to craft ReDoS. Like all ReDoS the impact is debatable.

Published Feb 28, 2024 · Updated Mar 15, 2026

Affected packages

rack

Ecosystem
RubyGems
Affected
>= 3.0.0, < 3.0.9.1
Fixed in
3.0.9.1
Check
bundle info rack

rack

Ecosystem
RubyGems
Affected
>= 0.4, < 2.2.8.1
Fixed in
2.2.8.1
Check
bundle info rack

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to byroot.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More RubyGems vulnerabilities

All RubyGems entries