The vulnerability, identified as CVE-2025-61770, is a denial-of-service (DoS) issue in Rack's multipart parsing logic. The root cause is the unbounded buffering of the multipart preamble, which is the data sent by a client before the first boundary in a multipart/form-data request.
The analysis of the provided patches, specifically commits 589127f4ac8b5cf11cf88fb0cd116ffed4d2181e, d869fed663b113b95a74ad53e1b5cae6ab31f29e, and e08f78c656c9394d6737c022bde087e0f33336fd, points to the Rack::Multipart::Parser.handle_fast_forward method as the core of the vulnerability. This function is part of a state machine responsible for finding the initial boundary. Before the fix, it would indefinitely append data to an internal buffer (@sbuf) while searching for the boundary, without any size checks. The patches rectify this by introducing a BOUNDARY_START_LIMIT and raising an error if the buffer size exceeds this limit.
Consequently, two key functions would appear in a runtime profile during an exploit:
Rack::Multipart::Parser.handle_fast_forward: This is the direct location of the vulnerable code. It's where the unbounded memory allocation occurs.
Rack::Multipart.parse_multipart: This is the high-level API function that applications call to parse multipart data. It initiates the parser and would be the entry point of the vulnerable operation in a stack trace.
An engineer with this CVE in their environment should be aware that any endpoint accepting multipart/form-data uploads is a potential vector. Monitoring memory usage on application workers handling these requests would likely show spikes corresponding to exploit attempts. The presence of Rack::Multipart.parse_multipart and Rack::Multipart::Parser.handle_fast_forward in performance profiles or stack traces of memory-intensive requests would be a strong indicator of this vulnerability being triggered.