CVE-2024-25126

MEDIUM5.3EPSS 0.45%

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

Published: 2/28/2024Modified: 2/4/2026
Also known as:GHSA-22f2-v57c-j9cxCGA-8j4q-ff96-64p9

Description

### Summary ```ruby 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: ```ruby request["Content-Type"] = (" " * 50_000) + "a," ``` ### Impact It's a very easy to craft ReDoS. Like all ReDoS the impact is debatable.

Affected packages (4)

CVSS scores

SourceVersionSeverityVector
osvCVSS 3.1MEDIUM5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

References (10)