GHSA-5v64-555j-wjxm: Rack: Multipart parsing allows DoS via unbounded scan buffer growth
Rack is a modular Ruby web server interface. Prior to 2.2.25, 3.1.23, and 3.2.8, Rack::Multipart::Parser can retain parsed data in its internal StringScanner buffer when reads end inside or immediately after multipart headers. An unauthenticated attacker can align many small parts with rack.multipart.buffersize boundaries so the buffer grows with the request despite per-field, header, and preamble limits, causing a worker to exhaust memory. The attack requires only a well-formed multipart body and affects applications that parse multipart requests. This issue is fixed in versions 2.2.25, 3.1.23, and 3.2.8.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Rackto a version that resolves this vulnerability.Fixed in 2.2.25 - Upgrade
Upgrade
Rackto a version that resolves this vulnerability.Fixed in 3.1.23 - Upgrade
Upgrade
Rackto a version that resolves this vulnerability.Fixed in 3.2.8
Event History
Frequently Asked Questions
Which applications are exposed to this denial-of-service issue?
Applications that parse multipart requests with Rack versions earlier than 2.2.25, 3.1.23, or 3.2.8 are affected. The request must reach multipart parsing; applications that do not parse multipart requests are not described as affected.
Does exploitation require authentication or malformed input?
No authentication is required. An attacker needs only to send a well-formed multipart request whose small parts are aligned with rack.multipart.buffer_size boundaries so reads end inside or immediately after multipart headers.
What is the operational impact of a successful attack?
The parser can retain parsed data in its internal StringScanner buffer despite per-field, header, and preamble limits. Repeated aligned parts can cause the buffer to grow with the request until a worker exhausts memory.
Which versions contain the fix?
The issue is fixed in Rack 2.2.25, 3.1.23, and 3.2.8. Upgrading to the applicable fixed release prevents the described unbounded scan-buffer growth.