Lucene search

K
osvGoogleOSV:GHSA-22F2-V57C-J9CX
HistoryFeb 28, 2024 - 10:57 p.m.

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

2024-02-2822:57:26
Google
osv.dev
8
rack mediatype
redos
content type parsing
vulnerability
http request
impact
software

5.3 Medium

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

LOW

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

5.1 Medium

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

10.5%

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.

Rows per page:
1-10 of 1181

5.3 Medium

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

LOW

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

5.1 Medium

AI Score

Confidence

High

0.0004 Low

EPSS

Percentile

10.5%