All vulnerabilities

RubyGems

CVE-2026-125111

Rack: Multipart parsing allows DoS via unbounded scan buffer growth

Severity
High 7.5
Published
10 Nov 2026
Last changed
10 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
2.2.25, 3.1.23, 3.2.8
Exploit chance
0.5% in the next 30 daysHigher than 43% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Uncontrolled resource consumption (CWE-400)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-5v64-555j-wjxm
Sources
OSV.dev and GitHub

Description

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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

  • 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.
Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
rackRubyGems · osv:RubyGems:rack
  • Every version before 2.2.25
  • From 3.0.0 before 3.1.23
  • From 3.2.0 before 3.2.8

About rack

Total downloads (RubyGems)
1,398,166,843RubyGems, 24 Nov 2026

References