[CVE-2022-44570] Possible Denial of Service Vulnerability in Rack’s Range header parsing
Rack's Range header parsing used a regular expression vulnerable to catastrophic backtracking, so crafted Range header values could make the parser take an unexpected amount of time. An unauthenticated attacker could send such requests to cause a denial of service, especially on servers serving files or streaming content.
- Triaged in 33 hours
- Fixed in 23 days
- Paid in 23 days
- Disclosed after 53 days
Summary by the program
There is a possible denial of service vulnerability in the Range header parsing component of Rack. This vulnerability has been assigned the CVE identifier CVE-2022-44570.
Versions Affected: >= 1.5.0
Not affected: None.
Fixed Versions: 2.0.9.2, 2.1.4.2, 2.2.6.1, 3.0.4.1
The report
I made a report and patch at https://hackerone.com/reports/1668717.
There is a possible denial of service vulnerability in the Range header parsing component of Rack. This vulnerability has been assigned the CVE identifier CVE-2022-44570. Carefully crafted input can cause the Range header parsing component in Rack to take an unexpected amount of time, possibly resulting in a denial of service attack vector. Any applications that deal with Range requests (such as streaming applications, or applications that serve files) may be impacted.
Impact
ReDoS occurs when crafted values are sent to request headers. Especially in Rails, access to public directories is affected.
It was possible to attack ReDoS on many servers without authentication, but in the case of this regular expression, if it is ruby 3.2 or higher, there is a memoization countermeasure, so it is not a threat.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a regular expression in Rack's Range header parser that is vulnerable to catastrophic backtracking (ReDoS).
Impact
An unauthenticated attacker could cause a denial of service by sending crafted Range headers, though on Ruby 3.2 or higher a memoization countermeasure reduces the threat.
What the attacker needed
No authentication needed; server parses Range headers
The fix
It was fixed in Rack versions [redacted], [redacted], [redacted] and 3.0.4.1.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A regular expression is a pattern used to check or extract text. Some patterns can become extremely slow when given specially crafted input, a problem called ReDoS (regular expression denial of service). Here, an attacker could send a request with a malicious Range header, which tells a server which part of a file to send, and tie up the server's processing time.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.