NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
💎
💎 RubyGems
Not in CISA KEV
HIGH severity

CVE-2026-142592 — rack

HIGHFix: rack/rack@7c16c66

CVE-2026-142592 is a high-severity (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in rack. A fix is available for rack — see the affected versions and patch details below.

Rack: Multipart parser searches the load path for every unknown part `charset`, allowing denial of service via CPU exhaustion.

Also known asGHSA-58mf-c3jj-277p
Published
Updated
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Dec 3, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-142592.

Real-World Exposure

2 pkgs affected
💎rack💎rack

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.

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. Rack rescues the resulting ArgumentError and falls back to binary, does not remember the failure, and does not limit the number of charset parameters a part may carry. An attacker can send a part whose Content-Type contains thousands of unknown charset parameters, and each one costs a full load-path search. This results in a denial of service condition for applications that accept multipart requests.

Details

The relevant code is:

if k == "charset"
  encoding = find_encoding(v)
end

def find_encoding(enc)
  Encoding.find enc
rescue ArgumentError
  Encoding::BINARY
end

For a name absent from Encoding.name_list, Encoding.find calls load_encoding in encoding.c, which requires enc/<name>.so through Ruby's internal loader. The lookup is not cached, is not visible to RubyGems or Bootsnap, and costs roughly 3–5 µs per $LOAD_PATH entry: about 30 µs on a bare Ruby, about 500 µs in a Bundler application with 200 load-path entries on macOS, and about 2.5 ms per lookup measured on Linux with 167 entries.

Each ;charset=x costs 10 bytes. Existing limits do not bound the attack: the part limit (RACK_MULTIPART_PART_LIMIT, 4096) counts parts, not parameters; the 64 KiB part header limit is only enforced when a header spans two reads, so a single header of up to the 1 MiB buffer size is accepted; and part headers count toward the 16 MiB retained-size limit, which allows about 1.6 million lookups per request. A single part with 4000 unknown charset parameters (64 KB) takes about 1.7 s to parse in a mid-sized Bundler application; a 1 MB request with 16 such parts takes 27–40 s. Through Puma in a default Rails application, four concurrent 1 MB requests delayed an unrelated health-check endpoint by over 10 s. The result is binary regardless of how many unknown names appear, so none of the lookups beyond the first are useful.

Rack 3.0, 3.1 and 3.2 are affected. Rack 2.2 is not affected by the denial of service: it does not rescue the ArgumentError, so 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. In a default Rails application a POST to any path, including one with no route, is sufficient, because Rack::MethodOverride parses the body before routing. An unauthenticated attacker can occupy a worker thread for tens of seconds with a request under 1 MB, and for minutes with a larger one; concurrent requests exhaust the thread pool. The cost grows with the number of gems in the application's bundle. No authentication, malformed HTTP, or unusual configuration is required.

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.

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
💎RubyGemsrack≥ 3.0.0&&< 3.1.243.1.24bundle update rack --conservative
💎RubyGemsrack≥ 3.2.0&&< 3.2.93.2.9bundle update rack --conservative

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for rack, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update rack to 3.1.24 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-142592 is resolved across your whole dependency graph.

  3. Workarounds

    Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.

Frequently Asked Questions

## 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. Rack rescues the resulting `ArgumentError` and falls back to binary, does not remember the failure, and does not limit the number of `charset` parameters a part may carry. An attacker can send a part whose `Content-Type` contains thousands of unknown `char
O3 Security · Impact-Aware SCA

Is CVE-2026-142592 in your dependencies?

Find it across RubyGems, including transitive dependencies.

CVE-2026-142592: rack DoS — Fixed in 3.1.24