CVE-2026-142591
## 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 limit
Properties
- Severity
- medium
- Summary
- Rack: `Rack::QueryParser` separator pattern allocates ~48 bytes per space after `&`, allowing denial of service via memory amplification
- Nvd fetched at
- 2026-12-04T15:00:48.841578+00:00
- Epss score
- 0.00607
- Cvss severity
- MEDIUM
- Cvss score
- 5.3
- Retrieved at
- 2026-12-04T15:02:58+00:00
- Ghsa published
- 2026-12-03T23:54:47Z
- Source url
- https://github.com/advisories/GHSA-f7cc-57h7-qrcg
- Ghsa updated
- 2026-12-03T23:54:48Z
- Ghsa id
- GHSA-f7cc-57h7-qrcg
- Last source
- FIRST EPSS
- Score
- 5.3
- Cvss version
- 3.1
- Cve id
- CVE-2026-142591
- Cvss vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- First seen by Signal
- 2026-12-02T22:45:38+00:00
- Name
- CVE-2026-142591
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Related Entities (3)
AFFECTS (1)
HAS_WEAKNESS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph