CVE-2026-142591: Rack Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-f7cc-57h7-qrcg
CVSS 5.3
CWE-400
Published
Advisory Summary

CVE-2026-142591 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Rack libraries in the RubyGems ecosystem. The issue involves `rack::queryparser` separator pattern allocates ~48 bytes per space after `&`, allowing denial of service via memory amplification. Remediation is available by upgrading affected packages to version 2.2.26, 3.1.24, 3.2.9.

CVE-2026-142591 at a Glance

CVE Identifier CVE-2026-142591
GHSA Identifier GHSA-f7cc-57h7-qrcg
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Rack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L).

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 Low (A:L)

How to Fix CVE-2026-142591

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: 2.2.26
Upgrade rack to 2.2.26
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-142591, 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 2.2.26), 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::QueryParser` splits query strings and `application/x-www-form-urlencoded` bodies on the regular expression `/& */n`, which also consumes spaces following each `&`. Matching a long run of spaces with this pattern makes Ruby's regular expression engine allocate about 48 bytes of backtracking state per space, so an input consisting of `&` followed by spaces causes the process to allocate roughly 48 times the size of the input. This results in a denial of service condition through memory exhaustion for applications that parse query strings or form bodies. ## Details The separator is defined as: ```ruby DEFAULT_SEP = /& */n COMMON_SEP = { ";" => /; */n, ";," => /[;,] */n, "&" => /& */n } ``` A body of `a=1&` followed by 4 MiB of spaces then `b=2` is one separator match. The match is linear in time (about 20 ms) but allocates about 186 MB of transient memory on top of the 4 MiB input, a factor of 46–48 that holds from 256 KiB (14 MB) to 16 MiB (770 MB). The memory is released after the match, so the peak is set by concurrency: with the default 4 MiB `RACK_QUERY_PARSER_BYTESIZE_LIMIT` and Puma's default of five threads, five concurrent requests reach about 1 GB. Applications that raise the limit for large forms scale accordingly; a 30 MiB body allocates about 1.5 GB. `RACK_QUERY_PARSER_BYTESIZE_LIMIT` bounds the input and therefore the cost per request, but the limit was introduced to cap parsing work at roughly the size of the input, and this multiplies it by about 48. `RACK_QUERY_PARSER_PARAMS_LIMIT` does not apply, since the input contains only one separator. The same per-byte cost arises from a second pattern in the parser, without any spaces in the input. When a parameter name uses array syntax, `params_hash_has_key?` splits the name on `/[\[\]]+/`; the `+` quantifier makes a long run of `[` or `]` characters allocate the same backtracking state. A body of `a[][b]=1&a[][` followed by 4 MiB of `[` has two parameters, is within the default limits, and allocates about 200 MB while being parsed. Rack 2.2 is additionally affected through `normalize_params`, where the pattern `/\A[\[\]]*([^\[\]]+)\]*/` applied to a long parameter name has the same cost. All supported versions are affected. The space-consuming separator dates from the first Rack release. ## Impact Any application that reads `request.params`, `request.GET` or `request.POST` is affected in its default configuration. An unauthenticated attacker sending a single urlencoded body or query string consisting mostly of spaces, or mostly of bracket characters in a parameter name, causes the process to allocate about 48 times the request size; several concurrent requests can exceed the memory of a small container and trigger the out-of-memory killer. No authentication is required, since the body is parsed before any session or CSRF check, and the request is well-formed HTTP. Normal clients never send unencoded spaces after `&`, as browsers encode them as `+` or `%20`. ## Mitigation * Update to a patched version of Rack, in which the separator is matched as a plain string, leading spaces are removed from each pair without a regular expression, and parameter names are split on brackets without a quantified pattern. * Lower `RACK_QUERY_PARSER_BYTESIZE_LIMIT` to the largest form body the application actually needs; the transient allocation is about 48 times that value per concurrent request. * At a reverse proxy, reject requests whose query string or urlencoded body contains unencoded space characters.

CVE-2026-142591 Affected Rack Versions

3 component(s)
Fixed Versions:
2.2.263.1.243.2.9
Product / Package Ecosystem Affected Versions Fixed Version
rack
RubyGems
< 2.2.26
2.2.26
rack
RubyGems
≥ 3.0
< 3.1.24
3.1.24
rack
RubyGems
≥ 3.2
< 3.2.9
3.2.9

References

Frequently Asked Questions

What is CVE-2026-142591?
CVE-2026-142591 is a security vulnerability in Rack involving `Rack::QueryParser` separator pattern allocates ~48 bytes per space after `&`, allowing denial of service via memory amplification under CWE-400: Uncontrolled Resource Consumption.
Which Rack versions are affected?
Affected versions include releases prior to 2.2.26, 3.1.24, 3.2.9 across affected packages: rack.
What version fixes CVE-2026-142591?
Upgrading to 2.2.26, 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 2.2.26, 3.1.24, 3.2.9. Upgrade your dependency to 2.2.26, 3.1.24, 3.2.9 or later.
What is the CVSS score of CVE-2026-142591?
CVE-2026-142591 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2026-142591?
CVE-2026-142591 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-142591?
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-f7cc-57h7-qrcg",
  "modified" : "2026-12-03T23:54:47Z",
  "published" : "2026-12-03T23:54:47Z",
  "aliases" : [ "CVE-2026-142591" ],
  "summary" : "Rack: `Rack::QueryParser` separator pattern allocates ~48 bytes per space after `&`, allowing denial of service via memory amplification",
  "details" : "## Summary\n\n`Rack::QueryParser` splits query strings and `application/x-www-form-urlencoded` bodies on the regular expression `/& */n`, which also consumes spaces following each `&`. Matching a long run of spaces with this pattern makes Ruby's regular expression engine allocate about 48 bytes of backtracking state per space, so an input consisting of `&` followed by spaces causes the process to allocate roughly 48 times the size of the input. This results in a denial of service condition through memory exhaustion for applications that parse query strings or form bodies.\n\n## Details\n\nThe separator is defined as:\n\n```ruby\nDEFAULT_SEP = /& */n\nCOMMON_SEP = { \";\" => /; */n, \";,\" => /[;,] */n, \"&\" => /& */n }\n```\n\nA body of `a=1&` followed by 4 MiB of spaces then `b=2` is one separator match. The match is linear in time (about 20 ms) but allocates about 186 MB of transient memory on top of the 4 MiB input, a factor of 46–48 that holds from 256 KiB (14 MB) to 16 MiB (770 MB). The memory is released after the match, so the peak is set by concurrency: with the default 4 MiB `RACK_QUERY_PARSER_BYTESIZE_LIMIT` and Puma's default of five threads, five concurrent requests reach about 1 GB. Applications that raise the limit for large forms scale accordingly; a 30 MiB body allocates about 1.5 GB.\n\n`RACK_QUERY_PARSER_BYTESIZE_LIMIT` bounds the input and therefore the cost per request, but the limit was introduced to cap parsing work at roughly the size of the input, and this multiplies it by about 48. `RACK_QUERY_PARSER_PARAMS_LIMIT` does not apply, since the input contains only one separator.\n\nThe same per-byte cost arises from a second pattern in the parser, without any spaces in the input. When a parameter name uses array syntax, `params_hash_has_key?` splits the name on `/[\\[\\]]+/`; the `+` quantifier makes a long run of `[` or `]` characters allocate the same backtracking state. A body of `a[][b]=1&a[][` followed by 4 MiB of `[` has two parameters, is within the default limits, and allocates about 200 MB while being parsed. Rack 2.2 is additionally affected through `normalize_params`, where the pattern `/\\A[\\[\\]]*([^\\[\\]]+)\\]*/` applied to a long parameter name has the same cost.\n\nAll supported versions are affected. The space-consuming separator dates from the first Rack release.\n\n## Impact\n\nAny application that reads `request.params`, `request.GET` or `request.POST` is affected in its default configuration. An unauthenticated attacker sending a single urlencoded body or query string consisting mostly of spaces, or mostly of bracket characters in a parameter name, causes the process to allocate about 48 times the request size; several concurrent requests can exceed the memory of a small container and trigger the out-of-memory killer. No authentication is required, since the body is parsed before any session or CSRF check, and the request is well-formed HTTP. Normal clients never send unencoded spaces after `&`, as browsers encode them as `+` or `%20`.\n\n## Mitigation\n\n* Update to a patched version of Rack, in which the separator is matched as a plain string, leading spaces are removed from each pair without a regular expression, and parameter names are split on brackets without a quantified pattern.\n* Lower `RACK_QUERY_PARSER_BYTESIZE_LIMIT` to the largest form body the application actually needs; the transient allocation is about 48 times that value per concurrent request.\n* At a reverse proxy, reject requests whose query string or urlencoded body contains unencoded space characters.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0"
      }, {
        "fixed" : "3.1.24"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2"
      }, {
        "fixed" : "3.2.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/security/advisories/GHSA-f7cc-57h7-qrcg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-142591"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/59fae908d13587922bb29a89c161441d4de0cab6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/bc0ad07de8603e545fb07936c8d28b9e7ec29804"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/d895d94b88a3233eb0f2e59d3ddb9fc6a0b630ef"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rack/rack"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/releases/tag/v2.2.26"
  }, {
    "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" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-03T23:54:47Z",
    "nvd_published_at" : "2026-12-02T22:18:36Z"
  }
}