ghsa-22f2-v57c-j9cx
Vulnerability from github
Published
2024-02-28 22:57
Modified
2024-06-10 18:30
Severity ?
Summary
Rack vulnerable to ReDoS in content type parsing (2nd degree polynomial)
Details
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": [ { "package": { "ecosystem": "RubyGems", "name": "rack" }, "ranges": [ { "events": [ { "introduced": "3.0.0" }, { "fixed": "3.0.9.1" } ], "type": "ECOSYSTEM" } ] }, { "package": { "ecosystem": "RubyGems", "name": "rack" }, "ranges": [ { "events": [ { "introduced": "0.4" }, { "fixed": "2.2.8.1" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2024-25126" ], "database_specific": { "cwe_ids": [ "CWE-1333" ], "github_reviewed": true, "github_reviewed_at": "2024-02-28T22:57:26Z", "nvd_published_at": "2024-02-29T00:15:51Z", "severity": "MODERATE" }, "details": "### Summary\n\n```ruby\nmodule Rack\n class MediaType\n SPLIT_PATTERN = %r{\\s*[;,]\\s*}\n```\nThe above regexp is subject to ReDos. 50K blank characters as a prefix to the header will take over 10s to split.\n\n### PoC\n\nA simple HTTP request with lots of blank characters in the content-type header:\n\n```ruby\nrequest[\"Content-Type\"] = (\" \" * 50_000) + \"a,\"\n```\n\n### Impact\n\nIt\u0027s a very easy to craft ReDoS. Like all ReDoS the impact is debatable.", "id": "GHSA-22f2-v57c-j9cx", "modified": "2024-06-10T18:30:52Z", "published": "2024-02-28T22:57:26Z", "references": [ { "type": "WEB", "url": "https://github.com/rack/rack/security/advisories/GHSA-22f2-v57c-j9cx" }, { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-25126" }, { "type": "WEB", "url": "https://github.com/rack/rack/commit/6efb2ceea003c4b195815a614e00438cbd543462" }, { "type": "WEB", "url": "https://github.com/rack/rack/commit/d9c163a443b8cadf4711d84bd2c58cb9ef89cf49" }, { "type": "WEB", "url": "https://discuss.rubyonrails.org/t/denial-of-service-vulnerability-in-rack-content-type-parsing/84941" }, { "type": "PACKAGE", "url": "https://github.com/rack/rack" }, { "type": "WEB", "url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2024-25126.yml" }, { "type": "WEB", "url": "https://lists.debian.org/debian-lts-announce/2024/04/msg00022.html" }, { "type": "WEB", "url": "https://security.netapp.com/advisory/ntap-20240510-0005" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "type": "CVSS_V3" } ], "summary": "Rack vulnerable to ReDoS in content type parsing (2nd degree polynomial)" }
Loading…
Loading…
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.