RubySec

Providing security resources for the Ruby community

GHSA-58mf-c3jj-277p (rack): CPU exhaustion in the Rack multipart parser

CPU exhaustion in the Rack multipart parser

Published: November 20, 2026

SECURITY IDENTIFIERS

GEM

rack

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.find is only called for names present in Encoding.name_list, so unknown charset values 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 charset parameters.