CPU exhaustion in the Rack multipart parser
Published: November 20, 2026
SECURITY IDENTIFIERS
- GHSA: GHSA-58mf-c3jj-277p
- Vendor Advisory: https://github.com/rack/rack/security/advisories/GHSA-58mf-c3jj-277p
GEM
SEVERITY
CVSS v3.x: 7.5 (High)
UNAFFECTED VERSIONS
< 3.0
PATCHED VERSIONS
>= 3.1.24, < 3.2
>= 3.2.9
DESCRIPTION
Summary
Rack::Multipart::Parser#tag_multipart_encoding calls Encoding.find once
for every charset parameter in the Content-Type header of a multipart
part. When the name is not a known encoding, Ruby's Encoding.find attempts
to load an encoding library of that name, which searches every directory on
$LOAD_PATH before failing.
In Rack 2.2, the ArgumentError raised by the first unknown charset aborts
parsing after a single lookup.
Impact
Any application that parses multipart bodies through Rack::Request#POST or
#params is affected in its default configuration.
Mitigation
- Update to a patched version of Rack, in which
Encoding.findis only called for names present inEncoding.name_list, so unknowncharsetvalues are mapped to binary without searching the load path. - At a reverse proxy, limit the size of multipart requests and reject requests
whose part headers contain many repeated
charsetparameters.
