Skip to content

GHSA-gjh7-p2fx-99vx CVE-2025-46727

Rack has an Unbounded-Parameter DoS in Rack::QueryParser

High RubyGems
Severity
7.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
1.21%
Chance of exploitation in the next 30 days. Higher than 68.38% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-400 Uncontrolled Resource Consumption
Fix
2.2.14
Upgrade rack to this version or later

Description

Summary

Rack::QueryParser parses query strings and application/x-www-form-urlencoded bodies into Ruby data structures without imposing any limit on the number of parameters, allowing attackers to send requests with extremely large numbers of parameters.

Details

The vulnerability arises because Rack::QueryParser iterates over each &-separated key-value pair and adds it to a Hash without enforcing an upper bound on the total number of parameters. This allows an attacker to send a single request containing hundreds of thousands (or more) of parameters, which consumes excessive memory and CPU during parsing.

Impact

An attacker can trigger denial of service by sending specifically crafted HTTP requests, which can cause memory exhaustion or pin CPU resources, stalling or crashing the Rack server. This results in full service disruption until the affected worker is restarted.

Mitigation

  • Update to a version of Rack that limits the number of parameters parsed, or
  • Use middleware to enforce a maximum query string size or parameter count, or
  • Employ a reverse proxy (such as Nginx) to limit request sizes and reject oversized query strings or bodies.

Limiting request body sizes and query string lengths at the web server or CDN level is an effective mitigation.

Affected versions

RubyGems

PackageVulnerableFixed in
rack
< 2.2.14
2.2.14
rack
>= 3.0, < 3.0.16
3.0.16
rack
>= 3.1, < 3.1.14
3.1.14

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

rack RubyGems → 2.2.14

bundler
bundle update rack # Gemfile: gem "rack", ">= 2.2.14"

Severity breakdown

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-400: Uncontrolled Resource Consumption

The product does not properly control the allocation and maintenance of a limited resource.

How to prevent it
  • Architecture and Design: Design throttling mechanisms into the system architecture. The best protection is to limit the amount of resources that an unauthorized user can cause to be expended. A strong authentication and access control model will help prevent such attacks from occurring in the first place. The login application should be protected against DoS attacks as much as possible. Limiting the database access, perhaps by caching result sets, can help minimize the resources expended. To further limit the potential for a DoS attack, consider tracking the rate of requests received from users and blocking requests that exceed a defined rate threshold.
  • Architecture and Design: Mitigation of resource exhaustion attacks requires that the target system either: recognizes the attack and denies that user further access for a given amount of time, or uniformly throttles all requests in order to make it more difficult to consume resources more quickly than they can again be freed. The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question. The second solution is simply difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker.
  • Architecture and Design: Ensure that protocols have specific limits of scale placed on them.
  • Implementation: Ensure that all failures in resource allocation place the system into a safe posture.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-g2pf-xv49-m2h5
Rack::Request accepts invalid Host characters, enabling host allowlist bypass
Medium Also affects rack
GHSA-v6x5-cg8r-vv6x
Rack's multipart header parsing allows Denial of Service via escape-heavy quoted parameters
High Also affects rack
GHSA-qfgr-crr9-7r49
Rack: Forwarded Header semicolon injection enables Host and Scheme spoofing
Medium Also affects rack
GHSA-rx22-g9mx-qrhv
Rack's improper unfolding of folded multipart headers preserves CRLF in parsed parameter values
Medium Also affects rack
GHSA-q2ww-5357-x388
Rack has Content-Length mismatch in Rack::Files error responses
Medium Also affects rack
GHSA-qv7j-4883-hwh7
Rack::Sendfile header-based X-Accel-Mapping regex injection enables unauthorized X-Accel-Redirect
High Also affects rack
GHSA-8vqr-qjwx-82mw
Rack's multipart parsing without Content-Length header allows unbounded chunked file uploads
High Also affects rack
GHSA-x8cg-fq8g-mxfx
Rack's multipart byte range processing allows denial of service via excessive overlapping ranges
High Also affects rack
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor