Rack: Multipart parsing allows DoS via unbounded scan buffer growth
CVE-2026-125111 · GHSA-5v64-555j-wjxm · EUVD-2026-120485 · published 9 Nov 2026
How serious is it
- Severity: high, CVSS score 8.7 out of 10.
- No exploit prediction (EPSS) score yet.
- Not on the CISA list of exploited vulnerabilities.
- No public exploit in Exploit-DB.
Is your app affected by CVE-2026-125111?
Paste this prompt into Claude Code, Cursor or any AI coding tool: it runs a free Shippable scan of your project and fixes what it finds. Built with Lovable, Bolt or v0? Scan your live app. Or upload your package file.
Who is affected
rack(RubyGems) < 2.2.25rack(RubyGems) >= 3.0.0, < 3.1.23rack(RubyGems) >= 3.2.0, < 3.2.8
How to check
- Run
bundle info rackin your project to see the installed version, including copies pulled in by other packages. - Or paste your lockfile into the checker: it lists every package with a known vulnerability, this one included.
How to fix
Copies a prompt for Claude Code, Cursor or Codex: it checks your lockfiles for this and upgrades it.
- On < 2.2.25: Upgrade
rackto 2.2.25 or later, commit the lockfile and redeploy. - On >= 3.0.0, < 3.1.23: Upgrade
rackto 3.1.23 or later, commit the lockfile and redeploy. - On >= 3.2.0, < 3.2.8: Upgrade
rackto 3.2.8 or later, commit the lockfile and redeploy. - If a vulnerable version was live, check your logs and rotate the secrets that server could read.
The advisory
## Summary
`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.
## Details
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.
## Impact
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.
## Mitigation
* Update to a patched version of Rack in which the parser discards parsed bytes from its scan buffer before reading more data.
* Limit the request body size at a reverse proxy or application boundary.
* Set `RACK_MULTIPART_PARSER_BYTESIZE_LIMIT` to the largest multipart body the application needs to accept, which bounds the memory a single request can hold.
Check your whole app
Dependencies are only half of it. Free and read-only: before you push, run npx shippable-dev scan localhost:3000 in your project folder, no account needed. For your live app, you prove it's yours with a one-line tag first.
References
- github.com/rack/rack/security/advisories/GHSA-5v64-555j-wjxm
- github.com/rack/rack/commit/244e75a840cee0823f86d5d01dc374505a8abed8
- github.com/rack/rack/commit/2eaa5b1026a03a43b6537b1a0b233707ba887702
- github.com/rack/rack/commit/c9b4698595050838342bd3b5a0fc9ab908065f8f
- nvd.nist.gov/vuln/detail/CVE-2026-125111
- github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/GHSA-5v64-555j-wjxm.yml
- github.com/advisories/GHSA-5v64-555j-wjxm
- github.com/rack/rack
Merged from ENISA EUVD, GitHub Advisory Database, OSV. Last updated 11 Nov 2026. All vulnerabilities · RSS · JSON