RACK · CVE-2026-125111 · Package
FIX → 3.2.8 · 2.2.25 +1
Rack's multipart parser keeps already-parsed request bytes in its scan buffer when parts are aligned with read chunks, so the buffer grows to the full request size. An unauthenticated attacker sending a crafted but well-formed multipart body can exhaust worker memory and deny service.
first public Oct 30, 2026 · 1 source
Could this affect your app?
Free first check from your website. Connect your repo for the full answer.
Any Ruby application that parses multipart requests through Rack in its default configuration is exposed, since the parser runs on every multipart body the server receives. Applications that only serve JSON or sit behind a proxy that caps request body size are much less exposed. Apps on a patched Rack version, or using a body size limit, can skip it.
Not affected if body-size-limit, no-multipart-endpoints, patched-version
Who cares rack, rails, ruby, self-hosted
Gemfile.lock (grep rack Gemfile.lock) and compare it with the fixed versions below.bundle exec gem list rack to see the version that actually loads.Rack::Multipart::Parser reads the request body in chunks of rack.multipart.buffer_size (1 MiB by default) into an internal scan buffer. Parsed bytes are only discarded from that buffer when a chunk ends inside a part body. A request whose parts are sized so that every chunk ends inside, or immediately after, a part's headers is never compacted, so the buffer grows to the size of the request.
This results in a denial of service condition through memory exhaustion for applications that parse multipart requests.
The parser appends each chunk read from the input to a StringScanner and advances through boundaries, headers, and bodies. In the body state, when no closing boundary is found, the consumed prefix is removed before more data is read. In the header state, and in the body state when no body bytes have been consumed yet, the parser requests more data without removing anything. Bytes skipped between parts are not counted against any limit.
An attacker can therefore construct parts that each fit within one chunk and align the chunk boundaries with the part headers. The existing limits on buffered non-file field data, header size, and preamble size do not apply, because each individual part remains small. With default limits the buffer can reach roughly 4 GiB (4096 parts of about 1 MiB). Ordinary file uploads aligned the same way are bounded by the file part limit at roughly 128 MiB per request.
Any application that parses multipart requests with Rack is affected in its default configuration. An unauthenticated attacker can cause a single request to hold memory proportional to its size for the duration of parsing, exhausting worker memory. The attack requires only a well-formed multipart body.
Check it with your coding agent
It reads this page and tells you if your code is affected.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
Upgrade to 3.2.8 · 2.2.25 +1
rack 2.x: upgrade to 2.2.25 or later.rack 3.1.x: upgrade to 3.1.23 or later.rack 3.2.x: upgrade to 3.2.8 or later.RACK_MULTIPART_PARSER_BYTESIZE_LIMIT to the largest multipart body the app needs, or limit request body size at a reverse proxy.RACK_MULTIPART_PARSER_BYTESIZE_LIMIT to the largest multipart body the application needs to accept, which bounds the memory a single request can hold.