Skip to main content

CVE-2025-46727: CWE-400: Uncontrolled Resource Consumption in rack rack

High
VulnerabilityCVE-2025-46727cvecve-2025-46727cwe-400cwe-770
Published: Wed May 07 2025 (05/07/2025, 23:07:40 UTC)
Source: CVE
Vendor/Project: rack
Product: rack

Description

Rack is a modular Ruby web server interface. Prior to versions 2.2.14, 3.0.16, and 3.1.14, `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. 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. 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. Versions 2.2.14, 3.0.16, and 3.1.14 fix the issue. Some other mitigations are available. One may 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.

AI-Powered Analysis

AILast updated: 07/05/2025, 06:57:03 UTC

Technical Analysis

CVE-2025-46727 is a high-severity vulnerability affecting the Rack Ruby web server interface, specifically its QueryParser component. Rack is widely used in Ruby web applications to handle HTTP requests and responses. The vulnerability exists in versions prior to 2.2.14, 3.0.16, and 3.1.14, where Rack::QueryParser does not impose any limits on the number of parameters parsed from query strings or application/x-www-form-urlencoded request bodies. This lack of bounds allows an attacker to craft HTTP requests containing an extremely large number of parameters, potentially hundreds of thousands or more. During parsing, Rack::QueryParser iterates over each key-value pair separated by '&' and adds them to a Hash without restriction, leading to uncontrolled resource consumption. The excessive memory allocation and CPU usage can exhaust server resources, causing denial of service (DoS) by stalling or crashing the Rack server process. This results in full service disruption until the affected worker is restarted. The vulnerability is exploitable remotely without authentication or user interaction, increasing its risk. The CVSS 3.1 score of 7.5 reflects a high severity, with network attack vector, low attack complexity, no privileges required, and no user interaction needed. Mitigations include upgrading to fixed versions 2.2.14, 3.0.16, or 3.1.14. Additional defenses involve deploying middleware to enforce maximum query string sizes or parameter counts, using reverse proxies like Nginx to limit request sizes and reject oversized queries or bodies, and limiting request body sizes at the web server or CDN level. These mitigations help prevent resource exhaustion by filtering or blocking maliciously large requests before they reach the Rack application.

Potential Impact

For European organizations, this vulnerability poses a significant risk of denial of service attacks against web applications built on Ruby using vulnerable Rack versions. Organizations relying on Ruby on Rails or other Rack-based frameworks may experience service outages, degraded performance, or crashes due to resource exhaustion triggered by malicious HTTP requests. This can disrupt business operations, degrade customer experience, and potentially cause financial losses or reputational damage. Since the vulnerability requires no authentication or user interaction, attackers can exploit it remotely at scale, increasing the likelihood of widespread impact. Critical services such as e-commerce platforms, government portals, financial services, and healthcare applications using Rack are particularly at risk. The disruption of these services can affect data availability and operational continuity, which are essential for compliance with European regulations like GDPR that mandate service reliability and data protection. Additionally, the increased CPU and memory usage may lead to higher infrastructure costs or trigger automated scaling that could be exploited for economic denial of service.

Mitigation Recommendations

European organizations should prioritize upgrading all Rack dependencies to versions 2.2.14, 3.0.16, or 3.1.14, which contain the official patches for this vulnerability. Where immediate upgrades are not feasible, implement middleware solutions that enforce strict limits on the maximum number of query parameters and the overall query string size to prevent excessive resource consumption during parsing. Deploy reverse proxies such as Nginx or Apache in front of Rack applications to limit the size of HTTP request bodies and query strings, rejecting requests that exceed configured thresholds. Configure web application firewalls (WAFs) to detect and block anomalous requests with unusually large numbers of parameters. Additionally, leverage CDN capabilities to filter oversized requests at the edge, reducing load on origin servers. Monitor application and server metrics for unusual spikes in CPU or memory usage that may indicate exploitation attempts. Establish incident response procedures to quickly restart affected workers or servers to restore service availability. Finally, conduct security awareness training for development teams to ensure secure coding practices and timely dependency management.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-04-28T20:56:09.084Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d9819c4522896dcbd85f8

Added to database: 5/21/2025, 9:08:41 AM

Last enriched: 7/5/2025, 6:57:03 AM

Last updated: 7/31/2025, 9:10:57 AM

Views: 15

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats