CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-142591

CVE-2026-142591: Denial of Service via Regex Memory Amplification in Rack QueryParser

Alon Barad
Alon Barad
Software Engineer

Dec 4, 2026·10 min read·5 visits

Executive Summary (TL;DR)

Quantified regular expressions in Rack::QueryParser cause Ruby's Onigmo regex engine to allocate 48 bytes of native backtracking state per matched character when processing long runs of spaces or square brackets. Unauthenticated attackers can achieve a 48x memory amplification (~200 MB per 4 MiB request), leading to Out-Of-Memory (OOM) Denial of Service across Rack versions prior to 2.2.26, 3.1.24, and 3.2.9.

CVE-2026-142591 (GHSA-f7cc-57h7-qrcg) is an uncontrolled resource consumption vulnerability in the Rack Ruby web server interface library. The flaw resides in Rack::QueryParser, which uses quantified regular expressions to split query strings, parse application/x-www-form-urlencoded request bodies, and evaluate nested parameter names. In Ruby's Onigmo regular expression engine, greedy quantifiers allocate approximately 48 bytes of native backtracking state per matched character. An unauthenticated remote attacker can transmit crafted payloads containing long runs of spaces or bracket characters within Rack's default 4 MiB byte-size limit to trigger an approximate 48x transient memory amplification, allocating up to 200 MB per request and exhausting process or container memory under concurrent load.

Vulnerability Overview

Rack (rack) provides a minimal, modular, and adaptable interface for developing web applications in Ruby. Positioned between the underlying web server (such as Puma, Unicorn, or Falcon) and the application framework (such as Ruby on Rails or Sinatra), Rack handles core HTTP parsing responsibilities. Within this architecture, Rack::QueryParser is directly exposed to untrusted external input, responsible for deserializing URI query strings and application/x-www-form-urlencoded HTTP request bodies into Ruby hashes.

In versions prior to 2.2.26, 3.1.24, and 3.2.9, Rack::QueryParser contains an uncontrolled resource consumption flaw classified under CWE-400. The parser relies on quantified regular expressions (DEFAULT_SEP, COMMON_SEP, and bracket-splitting expressions in params_hash_has_key? and normalize_params) to tokenize incoming key-value pairs and nested data structures.

When Ruby's regular expression engine evaluates these quantified patterns against long sequences of contiguous spaces or square brackets, it allocates native C heap or stack memory to store backtracking state frames. Each matched character in the quantified sequence forces an allocation of approximately 48 bytes. Because these allocations occur directly inside the native regex engine rather than the Ruby Virtual Machine object space, they bypass Ruby garbage collection accounting.

Existing input validation boundaries fail to prevent this behavior. The default byte-size threshold (RACK_QUERY_PARSER_BYTESIZE_LIMIT, set to 4 MiB) only constrains the raw string length of the incoming payload, while the parameter count threshold (RACK_QUERY_PARSER_PARAMS_LIMIT, set to 100) is bypassed because the amplification requires only two parameters. Consequently, a single 4 MiB request triggers roughly 190 to 200 MB of transient native memory allocation, allowing concurrent requests to exhaust host or container memory.

Root Cause Analysis

The root cause of CVE-2026-142591 lies in the interaction between quantified regular expressions in Rack::QueryParser and the state management architecture of Onigmo, Ruby's underlying regular expression engine. When Onigmo processes a pattern containing a greedy quantifier such as * (zero or more) or + (one or more), the engine records a backtracking state frame for every single character consumed by the quantifier before completing the match.

In Onigmo's native implementation, each backtracking state entry consumes 48 bytes of memory. Because Onigmo manages its execution stack and heap allocations at the C layer, these memory buffers are invisible to GC.stat and ObjectSpace. The memory remains pinned in the process Resident Set Size (RSS) until the String#split or regular expression match operation concludes.

The vulnerability manifests across three distinct execution paths in Rack::QueryParser. The primary vector occurs during top-level parameter splitting in each_query_pair. Rack defines separator constants with trailing space quantifiers (DEFAULT_SEP = /& */n and COMMON_SEP = { ";" => /; */n, ";," => /[;,] */n, "&" => /& */n }) to strip leading whitespace from parameter names automatically during qs.split. When an input contains an ampersand followed by millions of ASCII space characters (0x20), Onigmo pushes a 48-byte backtracking frame for every space.

A secondary vector exists within params_hash_has_key?, which is invoked during nested parameter parsing (parse_nested_query). When checking whether a nested hash key exists, the method splits the parameter key using key.split(/[\[\]]+/). Supplying a parameter name containing millions of consecutive opening or closing square brackets triggers the exact same 48-byte-per-character backtracking state allocation. A third legacy vector exists in the Rack 2.2 branch within normalize_params, which uses the quantified expressions %r(\A[\[\]]*([^\[\]]+)\]*) and %r(^\[\](.+)$) to extract nested key segments.

Code Analysis

The patch, committed across the 3.2 (59fae908d13587922bb29a89c161441d4de0cab6), 3.1 (d895d94b88a3233eb0f2e59d3ddb9fc6a0b630ef), and 2.2 (bc0ad07de8603e545fb07936c8d28b9e7ec29804) maintenance branches, eliminates all quantified regular expressions from the query splitting and bracket traversal paths.

In lib/rack/query_parser.rb, the maintainers replaced the quantified regular expressions in DEFAULT_SEP and COMMON_SEP with plain string literals and unquantified character classes. Passing a plain String to String#split uses fixed-delimiter C string scanning in Ruby rather than invoking Onigmo.

# Before Patch (lib/rack/query_parser.rb)
DEFAULT_SEP = /& */n
COMMON_SEP = { ";" => /; */n, ";," => /[;,] */n, "&" => /& */n }
 
# After Patch (lib/rack/query_parser.rb)
DEFAULT_SEP = "&"
COMMON_SEP = { ";" => ";", ";," => /[;,]/n, "&" => "&" }

To preserve backwards compatibility for stripping leading spaces after a delimiter, each_query_pair was refactored to decouple string splitting from whitespace removal. After splitting on the exact separator, the patched code inspects the first byte of each resulting token (pair.getbyte(0) == 32). If a leading space is present, it locates the first non-space boundary using pair.index(/[^ ]/), which searches forward linearly for a single character without allocating backtracking frames, and mutates the string in place via slice!.

# Patched each_query_pair in lib/rack/query_parser.rb
pairs = qs.split(separator ? (COMMON_SEP[separator] || /[#{separator}]/n) : DEFAULT_SEP, @params_limit + 1)
 
# Linear non-backtracking whitespace removal
pairs.each do |pair|
  pair.slice!(0, pair.index(/[^ ]/) || pair.length) if pair.getbyte(0) == 32
end

Similarly, params_hash_has_key? was rewritten to eliminate key.split(/[\[\]]+/). The patched implementation iterates through the parameter key using a while loop and positional index pointers (pos, start, stop). By invoking key.index(/[^\[\]]/, pos) to locate the start of a segment and key.index(/[\[\]]/, start) to locate the closing boundary, the parser extracts key segments in $O(N)$ time with $O(1)$ auxiliary regex memory.

# Patched params_hash_has_key? in lib/rack/query_parser.rb
pos = 0
while (start = key.index(/[^\[\]]/, pos))
  stop = key.index(/[\[\]]/, start) || key.length
  part = key[start, stop - start]
  return false unless params_hash_type?(hash) && hash.key?(part)
  hash = hash[part]
  pos = stop
end

In the Rack 2.2 branch (bc0ad07de8603e545fb07936c8d28b9e7ec29804), normalize_params required additional refactoring because it did not share the 3.x recursive parser design. The maintainers replaced the quantified regex captures (name =~ %r(\A[\[\]]*([^\[\]]+)\]*)) with equivalent positional index lookups (name.index(/[^\[\]]/) and name.index(/[\[\]]/, start)).

> [!NOTE] > The fix is comprehensive for Rack::QueryParser. The patch commit also introduces unit test assertions in test/spec_query_parser.rb that programmatically inspect DEFAULT_SEP and COMMON_SEP to verify that no regular expression contains quantifier metacharacters (/[*+?{]/).

Exploitation

Exploiting CVE-2026-142591 requires no authentication, privileges, or non-default configuration. Any publicly accessible HTTP endpoint powered by Rack that parses query strings or application/x-www-form-urlencoded request bodies is vulnerable. Because web frameworks like Ruby on Rails automatically invoke Rack::Request#params (or POST/GET parameter accessors) inside middleware or controller routing before application authentication logic runs, pre-authentication endpoints are directly exposed.

To maximize memory amplification while remaining below Rack's default enforcement thresholds, the attacker constructs a payload that satisfies RACK_QUERY_PARSER_BYTESIZE_LIMIT (4,194,304 bytes) and RACK_QUERY_PARSER_PARAMS_LIMIT (100 parameters). An HTTP POST request with Content-Type: application/x-www-form-urlencoded is the most reliable delivery vehicle because reverse proxies frequently limit HTTP GET URI lengths to 8 KiB or 32 KiB, whereas POST bodies are commonly permitted up to several megabytes.

The first exploitation method targets the separator whitespace quantifier in each_query_pair. The attacker transmits two parameters separated by an ampersand and padded with approximately 4,000,000 ASCII spaces (0x20):

POST /login HTTP/1.1
Host: target.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 4000008
 
a=1&[... 4,000,000 raw ASCII space bytes (0x20) ...]b=2

Note that the spaces must be transmitted as raw ASCII 0x20 bytes rather than URL-encoded + or %20 sequences, because each_query_pair executes qs.split prior to invoking URL unescaping on the individual pairs. When qs.split(/& */n) executes on this payload, Onigmo matches the ampersand and then evaluates * across 4,000,000 spaces, allocating $4,000,000 \times 48\text{ bytes} = 192,000,000\text{ bytes}$ (~183 MiB) of native memory in a single thread.

The second exploitation method targets the bracket-splitting regex in params_hash_has_key? during nested parameter evaluation. As demonstrated in the regression tests added in commit 59fae908d13587922bb29a89c161441d4de0cab6, the payload primes a nested structure and follows it with a key containing millions of contiguous bracket characters:

# Proof-of-Concept pattern derived from test/spec_query_parser.rb
query_parser = Rack::QueryParser.make_default(32)
brackets = "[" * 4_000_000
payload = "a[][b]=1&a[][#{brackets}=2"
query_parser.parse_nested_query(payload)

When parse_nested_query processes the second parameter, it calls params_hash_has_key?, which invokes key.split(/[\[\]]+/) on the 4,000,000-character bracket sequence. To turn this transient allocation into a sustained Denial of Service, an attacker dispatches concurrent requests equal to the server's thread concurrency (for example, 5 to 16 concurrent requests against a standard Puma cluster), forcing a sudden 1 GB to 3 GB memory spike that triggers the operating system's OOM killer.

Impact Assessment

The primary security impact of CVE-2026-142591 is Denial of Service (DoS) against the availability of the Ruby web application, mapped to MITRE ATT&CK technique T1499 (Endpoint Denial of Service). The vulnerability does not permit memory disclosure, arbitrary file access, or code execution, leaving Confidentiality and Integrity unaffected.

The CVSS v3.1 base score is 5.3 (Medium) with the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L. The Attack Vector is Network (AV:N) and Attack Complexity is Low (AC:L), requiring no privileges (PR:N) or user interaction (UI:N). Although the Availability impact is scored as Low (A:L) because the memory allocation from an isolated request is transient and freed once the regex evaluation completes, the operational impact in production environments is severe.

Modern containerized deployments (such as Kubernetes pods or AWS ECS tasks) run with strict cgroup memory ceilings (commonly 512 MB to 2 GB per container) and host multi-threaded application servers like Puma. Because Onigmo allocates backtracking state in native C memory outside the Ruby VM heap, Ruby's garbage collector is unaware of the memory pressure and does not trigger garbage collection sweeps to reclaim space. Furthermore, standard memory allocators (such as glibc malloc) frequently retain expanded heap arenas after large transient allocations rather than immediately returning pages to the kernel, causing permanent RSS bloat across worker processes.

As of December 2026, the Exploit Prediction Scoring System (EPSS) assigns CVE-2026-142591 a score of 0.00607 (0.61% probability of exploitation within 30 days, placing it in the 50.52nd percentile). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, and no weaponized standalone exploit modules exist in public repositories outside of the regression test cases in the official Rack patch commits.

Remediation

The definitive remediation is to upgrade the rack gem to a patched release that eliminates quantified regular expressions from Rack::QueryParser. The fixed versions are 2.2.26 (for the 2.2.x branch), 3.1.24 (for the 3.0.x and 3.1.x branches), and 3.2.9 (for the 3.2.x branch).

Administrators and developers should update their Gemfile dependencies and execute Bundler to lock the patched versions:

bundle update rack

For environments where an immediate gem upgrade cannot be deployed, operators can implement an application-level workaround by overriding the default query parser instance during application initialization (e.g., in config/initializers/rack_query_limit.rb for Ruby on Rails). Lowering the bytesize_limit parameter from the default 4 MiB (4,194,304 bytes) to 64 KiB (65,536 bytes) caps the maximum possible 48x regex amplification per request to approximately 3.1 MB:

# Application initializer workaround to bound maximum amplification
Rack::Utils.default_query_parser = Rack::QueryParser.make_default(
  Rack::Utils.key_space_limit, # Default: 65536
  65536                        # Lower bytesize_limit from 4 MiB to 64 KiB
)

> [!NOTE] > Reducing bytesize_limit globally applies to both URI query strings and application/x-www-form-urlencoded POST bodies. Applications that accept large form-encoded submissions (without using multipart/form-data or application/json) should verify that 64 KiB accommodates legitimate user traffic.

At the network edge, reverse proxies (such as NGINX or Envoy) and Web Application Firewalls (WAFs) should be configured to restrict query string sizes and inspect form-encoded request bodies. Blocking requests where the query string or application/x-www-form-urlencoded payload contains contiguous runs of 500 or more raw ASCII spaces (0x20) or square brackets ([ or ]) neutralizes exploitation attempts before they reach the Rack worker pool.

Official Patches

RackOfficial GitHub Security Advisory (GHSA-f7cc-57h7-qrcg)
RackRack v3.2.9 Release Notes
RackRack v3.1.24 Release Notes
RackRack v2.2.26 Release Notes

Fix Analysis (3)

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS Probability
0.61%
Top 49% most exploited

Affected Systems

Ruby on Rails applications using vulnerable Rack versionsSinatra, Hanami, and Roda web applications using vulnerable Rack versionsRuby web servers (Puma, Unicorn, Falcon, Passenger) running Rack < 2.2.26, >= 3.0.0 < 3.1.24, or >= 3.2.0 < 3.2.9

Affected Versions Detail

Product
Affected Versions
Fixed Version
rack
Rack
< 2.2.262.2.26
rack
Rack
>= 3.0.0, < 3.1.243.1.24
rack
Rack
>= 3.2.0, < 3.2.93.2.9
AttributeDetail
Vulnerability TypeUncontrolled Resource Consumption / Memory Amplification (CWE-400)
Affected ComponentRack::QueryParser (lib/rack/query_parser.rb)
Attack VectorNetwork (Unauthenticated HTTP GET/POST)
CVSS v3.1 Score5.3 Medium (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L)
EPSS Score0.61% (50.52nd Percentile)
Amplification Factor~48 bytes per character (~192 MB per 4 MiB request)
Exploit StatusProof-of-Concept in unit tests; Not in CISA KEV
Fixed VersionsRack 2.2.26, 3.1.24, 3.2.9

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-400
Uncontrolled Resource Consumption

The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to consume more resources than intended.

Known Exploits & Detection

GitHubOfficial patch commit containing regression test specifications in test/spec_query_parser.rb demonstrating the space and bracket amplification payloads.

Vulnerability Timeline

Fix committed to rack/rack repositories across 2-2-stable, 3-1-stable, and main branches by Jeremy Evans and Samuel Williams
2026-11-20
GitHub Security Advisory GHSA-f7cc-57h7-qrcg and CVE-2026-142591 published; patched versions 2.2.26, 3.1.24, and 3.2.9 released to RubyGems
2026-12-02
NVD record published and indexed with CVSS v3.1 score of 5.3
2026-12-02
EPSS score calculated at 0.00607 (50.52nd percentile)
2026-12-03

References & Sources

  • [1]GitHub Security Advisory GHSA-f7cc-57h7-qrcg
  • [2]Rack 3.2 Fix Commit (59fae908d13587922bb29a89c161441d4de0cab6)
  • [3]Rack 3.1 Fix Commit (d895d94b88a3233eb0f2e59d3ddb9fc6a0b630ef)
  • [4]Rack 2.2 Fix Commit (bc0ad07de8603e545fb07936c8d28b9e7ec29804)
  • [5]Rack v3.2.9 Release
  • [6]Rack v3.1.24 Release
  • [7]Rack v2.2.26 Release
  • [8]NVD - CVE-2026-142591
  • [9]CVE.org Record - CVE-2026-142591
  • [10]MITRE ATT&CK T1499 - Endpoint Denial of Service

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•19 minutes ago•GHSA-XJ2X-F8QW-37MR
5.3

GHSA-xj2x-f8qw-37mr: Denial of Service via Multi-Byte UTF-8 Slicing Panic in Rust bcrypt Crate

A denial-of-service vulnerability exists in versions 0.19.0 and 0.19.1 of the Rust bcrypt crate (tracked as GHSA-xj2x-f8qw-37mr and RUSTSEC-2026-0199). When parsing a 60-byte hash string containing multi-byte UTF-8 sequences positioned across internal slice offsets, the split_hash function performs direct string slicing across non-character boundaries. This violation of Rust's UTF-8 string invariants triggers an unhandled thread panic (str::slice_error_fail), enabling attackers who can supply or modify hash strings to crash authentication worker threads or terminate processes configured to abort on panic.

Alon Barad
Alon Barad
2 views•10 min read
•about 2 hours ago•CVE-2026-142592
7.5

CVE-2026-142592: Denial of Service via Multipart Charset Encoding Resolution in Rack

CVE-2026-142592 is an uncontrolled resource consumption vulnerability (CWE-400) in Rack, the modular Ruby web server interface. In affected versions within the 3.1.x and 3.2.x branches, the multipart form-data parser directly passes untrusted charset parameters to Ruby's internal Encoding.find method without pre-validation or caching. Because Ruby's MRI runtime traverses the entire $LOAD_PATH searching for shared libraries whenever an unknown encoding is requested, an unauthenticated attacker can submit a multipart payload with thousands of invalid charset parameters to trigger millions of filesystem lookup operations, exhausting CPU and I/O resources and causing denial of service.

Alon Barad
Alon Barad
5 views•13 min read
•about 3 hours ago•CVE-2026-142596
7.5

CVE-2026-142596: Projection Sanitization Bypass and Schema-Level Exclusion Disclosure in Mongoose

A projection sanitization and schema path exclusion bypass vulnerability exists in Mongoose versions 8.5.0 through 8.24.9 and 9.0.0 through 9.12.1. Due to insufficient validation of MongoDB projection syntax in `sanitizeProjection` and `applyPaths`, attackers supplying untrusted projection inputs to queries can force the retrieval of sensitive schema fields configured with `select: false`, such as password hashes, reset tokens, and multi-factor authentication secrets.

Amit Schendel
Amit Schendel
7 views•10 min read
•about 4 hours ago•CVE-2026-142595
6.5

CVE-2026-142595: NoSQL Query Operator Injection via Incomplete Denylist in Automattic Mongoose sanitizeFilter

CVE-2026-142595 is a NoSQL query operator injection vulnerability in Automattic Mongoose caused by an incomplete denylist in the sanitizeFilter query sanitization utility. Prior to the patched versions, sanitizeFilter blocked only four specific top-level operators ($jsonSchema, $where, $expr, and $text), allowing unrecognized or internal MongoDB operators such as $_internalSchemaXor and $_internalSchemaCond to pass through unsanitized. Attackers capable of supplying top-level filter keys can inject arbitrary nested query selectors to bypass authentication, extract sensitive data via boolean inference, or modify database records.

Amit Schendel
Amit Schendel
5 views•12 min read
•about 5 hours ago•CVE-2026-142610
7.5

CVE-2026-142610: Resource Exhaustion Denial of Service via Arbitrary-Precision Math in Laravel Framework

CVE-2026-142610 (GHSA-c25c-x5r7-2v5m) is an allocation of resources without limits or throttling vulnerability (CWE-770) in the Laravel Framework (`laravel/framework`). The flaw exists in how Laravel passes user-supplied numeric strings to the `brick/math` arbitrary-precision arithmetic library during specific validation rules (`multiple_of`, `gt`, `gte`, `lt`, `lte`) and Eloquent model decimal casting (`decimal:X`). When an unauthenticated remote attacker supplies a numeric string formatted in scientific notation with a large positive or negative exponent (e.g., `1e-100000000`), `Brick\Math\BigDecimal` and `Brick\Math\BigNumber` attempt to expand the full numeric representation in memory. This operation immediately exhausts the PHP process memory limit and causes high CPU utilization, terminating worker threads and resulting in an application-layer Denial of Service (DoS). The vulnerability is remediated in Laravel versions 12.74.0 and 13.44.1.

Alon Barad
Alon Barad
8 views•11 min read
•about 6 hours ago•CVE-2026-137198
8.3

CVE-2026-137198: Argument Injection in Node.js cross-spawn via Improper Backslash Escaping on Windows

CVE-2026-137198 is a high-severity argument injection vulnerability (CWE-88) affecting the Node.js cross-spawn library in versions 6.0.6 and 7.0.4 through 7.0.6. On Windows systems, when commands are routed through cmd.exe (including batch files and npm cmd-shims in node_modules/.bin), cross-spawn fails to properly double contiguous sequences of two or more backslashes preceding a double quote or at the end of an argument. This parsing failure causes the argument's closing quotation mark to be escaped as a literal character, allowing attacker-controlled input to break out of quotation encapsulation and inject arbitrary command-line arguments or consume subsequent arguments.

Amit Schendel
Amit Schendel
11 views•13 min read