Every CVESearch/Get API key

CVE-2026-142592

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

Explain with AI
ChatGPTClaudeGoogle AI
Severity
7.5High
Network attack, no privileges, no user interactionCVSS 3.1, CVE List
Exploitation
Unknown
No source reports exploitation yet.
Exploit chance
0.64% in 30 days
Percentile52nd
EPSS, scored
Listed fix
3.1.24 for rack
From GitHub Advisories and OSV1 more listed version, 1 other affected package

Overview

Rack is a modular Ruby web server interface. From 3.0.0 until 3.1.24 and 3.2.9, Rack::Multipart::Parser#tag_multipart_encoding calls Encoding.find for every charset parameter in a multipart part's Content-Type header without first checking Encoding.name_list. For an unknown name, Ruby searches each directory on $LOAD_PATH for an encoding library before raising ArgumentError, and Rack catches the exception without caching the failure or limiting repeated charset parameters. An unauthenticated attacker can send thousands of unknown charset parameters in a relatively small multipart request, occupying a worker thread for tens of seconds or longer, with cost increasing as the application's load path grows. Rack 2.2 is not affected by this denial of service because the first unknown charset aborts parsing. This issue is fixed in versions 3.1.24 and 3.2.9.

CVSS 3.1 vector

Exploitability

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

Impact

Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Exploit chance over time

Unchanged since Dec 3, 2026
EPSS score 0.64% every day from Dec 3, 2026 to Dec 4, 2026.

Affected

Packages 2

Affected packages
PackageAffectedFixed
rack
RubyGems
3.0.0 up to 3.1.24, plus listed versions
3.0.13.0.103.0.113.0.123.0.13
Show 41 more versionsShow less
3.0.143.0.153.0.163.0.173.0.183.0.23.0.33.0.43.0.4.13.0.4.23.0.53.0.63.0.6.13.0.73.0.83.0.93.0.9.13.1.03.1.13.1.103.1.113.1.123.1.133.1.143.1.153.1.163.1.173.1.183.1.193.1.23.1.203.1.213.1.223.1.233.1.33.1.43.1.53.1.63.1.73.1.83.1.9
3.1.24
3.2.0 up to 3.2.9, plus listed versions
3.2.13.2.23.2.33.2.43.2.53.2.63.2.73.2.8
3.2.9
gitlab-exporter
Docker Hardened Images:Debian:13
16.10.0-1 and later, plus listed versions
16.10.0-1016.10.0-1116.10.0-1216.10.0-1316.10.0-14
Show 45 more versionsShow less
16.10.0-1516.10.0-1616.10.0-1716.10.0-1816.10.0-1916.10.0-216.10.0-2016.10.0-2116.10.0-2216.10.0-2316.10.0-2416.10.0-2516.10.0-2616.10.0-2716.10.0-2816.10.0-2916.10.0-316.10.0-3016.10.0-3116.10.0-3216.10.0-3316.10.0-3416.10.0-3516.10.0-3616.10.0-3716.10.0-3816.10.0-3916.10.0-416.10.0-4016.10.0-4116.10.0-4216.10.0-4316.10.0-4416.10.0-4516.10.0-4616.10.0-4716.10.0-4816.10.0-4916.10.0-516.10.0-5016.10.0-5116.10.0-5216.10.0-616.10.0-716.10.0-8
None listed

The JSON record also has 1 more version.

Products 1

Sources

CVE List Score usedCVSS 3.17.5

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

Rack is a modular Ruby web server interface. From 3.0.0 until 3.1.24 and 3.2.9, Rack::Multipart::Parser#tag_multipart_encoding calls Encoding.find for every charset parameter in a multipart part's Content-Type header without first checking Encoding.name_list. For an unknown name, Ruby searches each directory on $LOAD_PATH for an encoding library before raising ArgumentError, and Rack catches the exception without caching the failure or limiting repeated charset parameters. An unauthenticated attacker can send thousands of unknown charset parameters in a relatively small multipart request, occupying a worker thread for tens of seconds or longer, with cost increasing as the application's load path grows. Rack 2.2 is not affected by this denial of service because the first unknown charset aborts parsing. This issue is fixed in versions 3.1.24 and 3.2.9.

Record
CVE-2026-142592
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-12-03
EUVDEUVD-2026-141927CVSS 3.17.5

Rack is a modular Ruby web server interface. From 3.0.0 until 3.1.24 and 3.2.9, Rack::Multipart::Parser#tag_multipart_encoding calls Encoding.find for every charset parameter in a multipart part's Content-Type header without first checking Encoding.name_list. For an unknown name, Ruby searches each directory on $LOAD_PATH for an encoding library before raising ArgumentError, and Rack catches the exception without caching the failure or limiting repeated charset parameters. An unauthenticated attacker can send thousands of unknown charset parameters in a relatively small multipart request, occupying a worker thread for tens of seconds or longer, with cost increasing as the application's load path grows. Rack 2.2 is not affected by this denial of service because the first unknown charset aborts parsing. This issue is fixed in versions 3.1.24 and 3.2.9.

Record
EUVD-2026-141927
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-12-02
GitHub AdvisoriesGHSA-58mf-c3jj-277pCVSS 3.17.5

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

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.
Record
GHSA-58mf-c3jj-277p
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-12-04
NVDCVSS 3.17.5

Rack is a modular Ruby web server interface. From 3.0.0 until 3.1.24 and 3.2.9, Rack::Multipart::Parser#tag_multipart_encoding calls Encoding.find for every charset parameter in a multipart part's Content-Type header without first checking Encoding.name_list. For an unknown name, Ruby searches each directory on $LOAD_PATH for an encoding library before raising ArgumentError, and Rack catches the exception without caching the failure or limiting repeated charset parameters. An unauthenticated attacker can send thousands of unknown charset parameters in a relatively small multipart request, occupying a worker thread for tens of seconds or longer, with cost increasing as the application's load path grows. Rack 2.2 is not affected by this denial of service because the first unknown charset aborts parsing. This issue is fixed in versions 3.1.24 and 3.2.9.

Record
CVE-2026-142592
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-12-03
OSVCVSS 3.17.5

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

Rack is a modular Ruby web server interface. From 3.0.0 until 3.1.24 and 3.2.9, Rack::Multipart::Parser#tag_multipart_encoding calls Encoding.find for every charset parameter in a multipart part's Content-Type header without first checking Encoding.name_list. For an unknown name, Ruby searches each directory on $LOAD_PATH for an encoding library before raising ArgumentError, and Rack catches the exception without caching the failure or limiting repeated charset parameters. An unauthenticated attacker can send thousands of unknown charset parameters in a relatively small multipart request, occupying a worker thread for tens of seconds or longer, with cost increasing as the application's load path grows. Rack 2.2 is not affected by this denial of service because the first unknown charset aborts parsing. This issue is fixed in versions 3.1.24 and 3.2.9.

Record
CVE-2026-142592
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-12-03
OSVDHI-2etm-ao5t-iiay-kh3kCVSS 3.17.5

Rack is a modular Ruby web server interface. From 3.0.0 until 3.1.24 and 3.2.9…

Rack is a modular Ruby web server interface. From 3.0.0 until 3.1.24 and 3.2.9, Rack::Multipart::Parser#tag_multipart_encoding calls Encoding.find for every charset parameter in a multipart part's Content-Type header without first checking Encoding.name_list. For an unknown name, Ruby searches each directory on $LOAD_PATH for an encoding library before raising ArgumentError, and Rack catches the exception without caching the failure or limiting repeated charset parameters. An unauthenticated attacker can send thousands of unknown charset parameters in a relatively small multipart request, occupying a worker thread for tens of seconds or longer, with cost increasing as the application's load path grows. Rack 2.2 is not affected by this denial of service because the first unknown charset aborts parsing. This issue is fixed in versions 3.1.24 and 3.2.9.

Record
DHI-2etm-ao5t-iiay-kh3k
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-12-04
OSVGHSA-58mf-c3jj-277pCVSS 3.17.5

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

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.
Record
GHSA-58mf-c3jj-277p
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-12-04

History

Recorded by Every CVE

Changes recorded by Every CVE
DayChangedSources
ReferencesOSV
Affected packages, other IDs, referencesOSV
Affected packages, referencesOSV
Affected packages, key facts, references
4 sourcesShow lessCVE List, GitHub Advisories, NVD, OSV
Other IDs, referencesOSV
Other IDs, published dateEUVD, NVD
First indexedCVE List

Upstream dates may differ.

References

Show 4 more referencesShow less
MoveEnter Open