CVE-2024-25126
JSON

5.3medium

Rack ReDos in content type parsing (2nd degree polynomial)

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
35.4% (higher than 98% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-22f2-v57c-j9cx

Description

Rack is a modular Ruby web server interface. Carefully crafted content type headers can cause Rack’s media type parser to take much longer than expected, leading to a possible denial of service vulnerability (ReDos 2nd degree polynomial). This vulnerability is patched in 3.0.9.1 and 2.2.8.1.

Affected

Product or packageVersionsReported by
rack rack>= 3.0.0, < 3.0.9.1, >= 0.4, < 2.2.8.1, from 0.4 before 2.2.8.1, from 3.0.0 before 3.0.9.1CVE List, NVD
rack_project rackfrom 3.0.0 before 3.0.9.1, from 0.4 before 2.2.8.1CVE List
rack (RubyGems)from 3.0.0 before 3.0.9.1, from 0.4 before 2.2.8.1GitHub Advisory Database
debian debian_linux10.0NVD

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-1333

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

Rack is a modular Ruby web server interface. Carefully crafted content type headers can cause Rack’s media type parser to take much longer than expected, leading to a possible denial of service vulnerability (ReDos 2nd degree polynomial). This vulnerability is patched in 3.0.9.1 and 2.2.8.1.

GitHub Advisory Database
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.

NVD (es)

Rack es una interfaz modular de servidor web Ruby. Los encabezados de tipo de contenido cuidadosamente elaborados pueden hacer que el analizador de tipo de medios de Rack demore mucho más de lo esperado, lo que lleva a una posible vulnerabilidad de denegación de servicio (polinomio de segundo grado de ReDos). Esta vulnerabilidad está parcheada en 3.0.9.1 y 2.2.8.1.

References

https://github.com/rack/rack/security/advisories/GHSA-22f2-v57c-j9cxexploit, vendor-advisory, web
https://github.com/rack/rack/commit/6efb2ceea003c4b195815a614e00438cbd543462patch, web
https://github.com/rack/rack/commit/d9c163a443b8cadf4711d84bd2c58cb9ef89cf49patch, web
https://discuss.rubyonrails.org/t/denial-of-service-vulnerability-in-rack-content-type-parsing/84941exploit, vendor-advisory, web
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2024-25126.ymlexploit, third-party-advisory, web
https://lists.debian.org/debian-lts-announce/2024/04/msg00022.htmlmailing-list, web
https://security.netapp.com/advisory/ntap-20240510-0005/third-party-advisory
https://nvd.nist.gov/vuln/detail/CVE-2024-25126advisory
https://github.com/rack/rackpackage
https://security.netapp.com/advisory/ntap-20240510-0005web

Sources

SourceRecordLicence
CVE ListCVE-2024-25126 changed 2025-02-13CVE Terms of Use
GitHub Advisory DatabaseGHSA-22f2-v57c-j9cx changed 2026-09-10CC-BY-4.0
NVDCVE-2024-25126 changed 2026-06-17Public domain