All reports
Medium

Rack vulnerable to ReDoS in content type parsing (2nd degree polynomial)

Affected versions

Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported
RubyGemsrack
Affected versions
>= 3.0.0, < 3.0.9.1
Fixed version
3.0.9.1
RubyGemsrack
Affected versions
>= 0.4, < 2.2.8.1
Fixed version
2.2.8.1

Exploitation

CVE-2024-25126

Probability of exploitation in the next 30 days: 35.38%

FIRST EPSS · 2026-11-23

Description

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.

Links

Credits

  • byroot