CVE-2026-142592
## 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: ```ruby 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
Properties
- Severity
- high
- Summary
- Rack: Multipart parser searches the load path for every unknown part `charset`, allowing denial of service via CPU exhaustion
- Nvd fetched at
- 2026-12-04T15:00:48.841578+00:00
- Epss score
- 0.00644
- Cvss severity
- HIGH
- Cvss score
- 7.5
- Retrieved at
- 2026-12-04T15:02:58+00:00
- Ghsa published
- 2026-12-03T23:55:28Z
- Source url
- https://github.com/advisories/GHSA-58mf-c3jj-277p
- Ghsa updated
- 2026-12-03T23:55:28Z
- Ghsa id
- GHSA-58mf-c3jj-277p
- Last source
- FIRST EPSS
- Score
- 7.5
- Cvss version
- 3.1
- Cve id
- CVE-2026-142592
- Cvss vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- First seen by Signal
- 2026-12-02T22:45:38+00:00
- Name
- CVE-2026-142592
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Related Entities (3)
AFFECTS (1)
HAS_WEAKNESS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph