Vulnerabilities in pkg:gem/rack

PACKAGE
Advisory Identifier: GHSA-58mf-c3jj-277p
Advisory Summary

CVE-2026-142592 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Rack libraries in the RubyGems ecosystem. The issue involves multipart parser searches the load path for every unknown part `charset`, allowing denial of service via cpu exhaustion. Remediation is available by upgrading affected packages to version 3.1.24, 3.2.9.

56 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/rack

56 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/rack. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-58mf-c3jj-277p CVE-2026-142592 HIGH Rack: Multipart parser searches the load path for every unknown part `charset`, allowing denial of service via CPU exhaustion
GHSA-f7cc-57h7-qrcg CVE-2026-142591 MODERATE Rack: `Rack::QueryParser` separator pattern allocates ~48 bytes per space after `&`, allowing denial of service via memory amplification
GHSA-mhj6-xc86-54m8 CVE-2026-142593 MODERATE Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link
GHSA-r243-pfwh-7rpx CVE-2026-142594 LOW Rack: `Rack::Multipart` extracts the boundary by substring match rather than parameter parsing, allowing parser differentials and WAF bypass
GHSA-frgv-948x-h96g CVE-2026-142590 MODERATE Rack: `Rack::Multipart::Parser` preserves CRLF from multipart part headers in parsed parameter names (incomplete fix for CVE-2026-26962)
GHSA-g2pf-xv49-m2h5 CVE-2026-34835 MODERATE Rack::Request accepts invalid Host characters, enabling host allowlist bypass
GHSA-q2ww-5357-x388 CVE-2026-34831 MODERATE Rack has Content-Length mismatch in Rack::Files error responses
GHSA-qv7j-4883-hwh7 CVE-2026-34830 MODERATE Rack::Sendfile header-based X-Accel-Mapping regex injection enables unauthorized X-Accel-Redirect
GHSA-8vqr-qjwx-82mw CVE-2026-34829 HIGH Rack's multipart parsing without Content-Length header allows unbounded chunked file uploads
GHSA-v6x5-cg8r-vv6x CVE-2026-34827 HIGH Rack's multipart header parsing allows Denial of Service via escape-heavy quoted parameters
GHSA-7mqq-6cf9-v2qp CVE-2026-34763 MODERATE Rack has a root directory disclosure via unescaped regex interpolation in Rack::Directory
GHSA-v569-hp3g-36wr CVE-2026-34230 HIGH Rack has quadratic complexity in Rack::Utils.select_best_encoding via wildcard Accept-Encoding header
GHSA-qfgr-crr9-7r49 CVE-2026-32762 MODERATE Rack: Forwarded Header semicolon injection enables Host and Scheme spoofing
GHSA-rx22-g9mx-qrhv CVE-2026-26962 MODERATE Rack's improper unfolding of folded multipart headers preserves CRLF in parsed parameter values
GHSA-vgpv-f759-9wx3 CVE-2026-26961 MODERATE Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass.
GHSA-x8cg-fq8g-mxfx CVE-2026-34826 MODERATE Rack's multipart byte range processing allows denial of service via excessive overlapping ranges
GHSA-q4qf-9j86-f5mh CVE-2026-34786 MODERATE Rack:: Static header_rules bypass via URL-encoded paths
GHSA-h2jq-g4cq-5ppq CVE-2026-34785 HIGH Rack::Static prefix matching can expose unintended files under the static root
GHSA-whrj-4476-wvmp CVE-2026-25500 MODERATE Stored XSS in Rack::Directory via javascript: filenames rendered into anchor href
GHSA-mxw3-3hh2-x2mh CVE-2026-22860 HIGH Rack has a Directory Traversal via Rack:Directory
GHSA-8cgq-6mh2-7j6v CVE-2025-27111 MODERATE Escape Sequence Injection vulnerability in Rack lead to Possible Log Injection
GHSA-7wqh-767x-r66v CVE-2025-27610 HIGH Local File Inclusion in Rack::Static
GHSA-7g2v-jj9q-g3rg CVE-2025-25184 MODERATE Possible Log Injection in Rack::CommonLogger
GHSA-6xw4-3v39-52mm CVE-2025-61919 HIGH Rack is vulnerable to a memory-exhaustion DoS through unbounded URL-encoded body parsing
GHSA-r657-rxjc-j557 CVE-2025-61780 MODERATE Rack has a Possible Information Disclosure Vulnerability
GHSA-wpv5-97wm-hp9c CVE-2025-61772 HIGH Rack's multipart parser buffers unbounded per-part headers, enabling DoS (memory exhaustion)
GHSA-w9pc-fmgc-vxvw CVE-2025-61771 HIGH Rack: Multipart parser buffers large non‑file fields entirely in memory, enabling DoS (memory exhaustion)
GHSA-p543-xpfm-54cp CVE-2025-61770 HIGH Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion)
GHSA-625h-95r8-8xpm CVE-2025-59830 HIGH Rack has an unsafe default in Rack::QueryParser allows params_limit bypass via semicolon-separated parameters
GHSA-47m2-26rw-j2jw CVE-2025-49007 MODERATE ReDoS Vulnerability in Rack::Multipart handle_mime_head
GHSA-gjh7-p2fx-99vx CVE-2025-46727 HIGH Rack has an Unbounded-Parameter DoS in Rack::QueryParser
GHSA-vpfw-47h7-xj4g CVE-2025-32441 MODERATE Rack session gets restored after deletion
GHSA-3h57-hmj3-gj3p CVE-2023-27530 HIGH Rack has possible DoS Vulnerability in Multipart MIME parsing
GHSA-65f5-mfpf-vfhj CVE-2022-44570 HIGH Denial of service via header parsing in Rack
GHSA-hrqr-hxpp-chr3 CVE-2019-16782 MODERATE Possible Information Leak / Session Hijack Vulnerability in Rack
GHSA-c6qg-cjj8-47qp CVE-2023-27539 LOW Possible Denial of Service Vulnerability in Rack's header parsing
GHSA-cj83-2ww7-mvq7 CVE-2024-39316 MODERATE Rack ReDoS Vulnerability in HTTP Accept Headers Parsing
GHSA-22f2-v57c-j9cx CVE-2024-25126 MODERATE Rack vulnerable to ReDoS in content type parsing (2nd degree polynomial)
GHSA-54rr-7fvw-6x8f CVE-2024-26146 LOW Rack Header Parsing leads to Possible Denial of Service Vulnerability
GHSA-xj5v-6v4g-jfw6 CVE-2024-26141 LOW Rack has possible DoS Vulnerability with Range Header
GHSA-93pm-5p5f-3ghx CVE-2022-44571 LOW Denial of Service Vulnerability in Rack Content-Disposition parsing
GHSA-rqv2-275x-2jq5 CVE-2022-44572 LOW Denial of service via multipart parsing in Rack
GHSA-hxqx-xwvh-44m2 CVE-2022-30122 HIGH Denial of Service Vulnerability in Rack Multipart Parsing
GHSA-3pxh-h8hw-mj8w CVE-2013-0183 MODERATE Rack rubygems receiving excessively long lines triggers out-of-memory error
GHSA-5r2p-j47h-mhpg CVE-2018-16471 MODERATE Rack vulnerable to Cross-site Scripting
GHSA-hg78-4f6x-99wq CVE-2018-16470 HIGH Rack vulnerable to Denial of Service
GHSA-j6w9-fv6q-3q52 CVE-2020-8184 HIGH Rack allows Percent-encoded cookies to overwrite existing prefixed cookie names
GHSA-85r7-w5mv-c849 CVE-2013-0262 MODERATE Rack Vulnerable to Path Traversal
GHSA-h77x-m5q8-c29h CVE-2012-6109 MODERATE Rack vulnerable to REDoS
GHSA-v6j3-7jrw-hq2p CVE-2011-5036 MODERATE Rack Gem Subject to Denial of Service via Hash Collisions
GHSA-rgr4-9jh5-j4j6 CVE-2015-3225 MODERATE Rack vulnerable to Denial of Service via large parameter depth request
GHSA-v882-ccj6-jc48 CVE-2013-0184 MODERATE Rack vulnerable to Denial of Service
GHSA-wq4h-7r42-5hrr CVE-2022-30123 CRITICAL Possible shell escape sequence injection vulnerability in Rack
GHSA-xc85-32mf-xpv8 CVE-2013-0263 MODERATE Rack arbitrary code execution via timing attack
GHSA-5f9h-9pjv-v6j7 CVE-2020-8161 HIGH Directory traversal in Rack::Directory app bundled with Rack
GHSA-9vc2-p34x-jhxh - MODERATE Moderate severity vulnerability that affects rack

CVE-2026-142592 at a Glance

CVE Identifier CVE-2026-142592
GHSA Identifier GHSA-58mf-c3jj-277p
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Rack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-142592

To remediate this vulnerability, upgrade all affected Rack dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rack fixed: 3.1.24
Upgrade rack to 3.1.24
rack fixed: 3.2.9
Upgrade rack to 3.2.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rack

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-142592, inspect your project dependencies for Rack:

inspect dependencies for rack

Analyze the terminal output to locate any version of Rack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.24), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Rack, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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 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.

CVE-2026-142592 Affected Rack Versions

2 component(s)
Fixed Versions:
3.1.243.2.9
Product / Package Ecosystem Affected Versions Fixed Version
rack
RubyGems
≥ 3.0.0
< 3.1.24
3.1.24
rack
RubyGems
≥ 3.2.0
< 3.2.9
3.2.9

References

Frequently Asked Questions

What is CVE-2026-142592?
CVE-2026-142592 is a security vulnerability in Rack involving Multipart parser searches the load path for every unknown part `charset`, allowing denial of service via CPU exhaustion under CWE-400: Uncontrolled Resource Consumption.
Which Rack versions are affected?
Affected versions include releases prior to 3.1.24, 3.2.9 across affected packages: rack.
What version fixes CVE-2026-142592?
Upgrading to 3.1.24, 3.2.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rack affected?
Yes, rack is affected in releases prior to 3.1.24, 3.2.9. Upgrade your dependency to 3.1.24, 3.2.9 or later.
What is the CVSS score of CVE-2026-142592?
CVE-2026-142592 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-142592?
CVE-2026-142592 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check RubyGems dependencies for CVE-2026-142592?
Run the dependency tree command: 'inspect dependencies for rack'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-58mf-c3jj-277p",
  "modified" : "2026-12-03T23:55:28Z",
  "published" : "2026-12-03T23:55:28Z",
  "aliases" : [ "CVE-2026-142592" ],
  "summary" : "Rack: Multipart parser searches the load path for every unknown part `charset`, allowing denial of service via CPU exhaustion",
  "details" : "## Summary\n\n`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.\n\n## Details\n\nThe relevant code is:\n\n```ruby\nif k == \"charset\"\n  encoding = find_encoding(v)\nend\n\ndef find_encoding(enc)\n  Encoding.find enc\nrescue ArgumentError\n  Encoding::BINARY\nend\n```\n\nFor 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.\n\nEach `;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.\n\nRack 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.\n\n## Impact\n\nAny 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.\n\n## Mitigation\n\n* 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.\n* At a reverse proxy, limit the size of multipart requests and reject requests whose part headers contain many repeated `charset` parameters.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.1.24"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.0"
      }, {
        "fixed" : "3.2.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/security/advisories/GHSA-58mf-c3jj-277p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-142592"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/7c16c669fe2040ac395cf05a242f80527ddab16b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/8ae2ea868a13eec2cfa7065a1ea8b527c567fad9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rack/rack"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/releases/tag/v3.1.24"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/releases/tag/v3.2.9"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-03T23:55:28Z",
    "nvd_published_at" : "2026-12-02T22:18:36Z"
  }
}