[CVE-2022-44571] Possible Denial of Service Vulnerability in Rack Content-Disposition parsing
The Content-Disposition header parser in Rack could be made to take an unexpectedly long time by carefully crafted input, which could be used as a denial of service vector. Because the input is in the request body, the header size limit could be bypassed, and the issue affected virtually all Rails applications that parse multipart posts.
- Triaged in 33 hours
- Fixed in 23 days
- Paid in 23 days
- Disclosed after 53 days
Summary by the program
There is a denial of service vulnerability in the Content-Disposition parsing component of Rack. This vulnerability has been assigned the CVE identifier CVE-2022-44571.
Versions Affected: >= 2.0.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/1675235
There is a denial of service vulnerability in the Content-Disposition parsing component of Rack. This vulnerability has been assigned the CVE identifier CVE-2022-44571. Carefully crafted input can cause Content-Disposition header parsing in Rack to take an unexpected amount of time, possibly resulting in a denial of service attack vector. This header is used typically used in multipart parsing. Any applications that parse multipart posts using Rack (virtually all Rails applications) are impacted.
Impact
Any applications that parse multipart posts using Rack (virtually all Rails applications) are impacted. Since it is a manipulation of the request body, it is possible to bypass the request header size limit and make more dangerous attacks.
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 the Content-Disposition parser that could backtrack excessively on crafted input, causing the parsing to take an unexpected amount of time.
Impact
Applications that parse multipart posts using Rack could be slowed down, and since the crafted input is in the request body, the request header size limit could be bypassed; however, on Ruby 3.2 or higher a memoization countermeasure means it is not a threat.
What the attacker needed
No authentication needed; application parses multipart posts
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.
Rack is a piece of software that many Ruby web applications use to read incoming requests. A denial of service means making a service so slow or busy that real users cannot use it. Here, a specially shaped upload header made the parser work much harder than normal, so an attacker could tie up the server without needing an account.
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.