CVE-2024-41128
NoneCVSS
—
EPSS
1.1%
Published
Oct 16, 2024
CISA due date
—
Cloudanix analysis
A flaw in a popular web development tool could allow an attacker to make a website or service unavailable simply by sending a specially crafted web request.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Web Framework
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
A Regular Expression Denial of Service (ReDoS) vulnerability exists in the query parameter filtering mechanism of Action Pack, a core component of Ruby on Rails. An attacker can send a web request with specially crafted query parameters that cause the regular expression engine to enter a state of catastrophic backtracking. This consumes excessive CPU resources, leading to a single worker process becoming unresponsive. By sending multiple such requests, an attacker can exhaust all available application server processes, resulting in a complete denial of service for the application.
Why it matters to the business
Exploitation of this vulnerability will render the affected web application or service completely unavailable to legitimate users. This can lead to operational disruption, customer dissatisfaction, potential revenue loss for e-commerce platforms, and damage to the organization's reputation. As Ruby on Rails is a widely used framework, the potential for impact is significant across many web applications. The vulnerability does not lead to data compromise, but the service outage can be severe.
How an attack unfolds
An unauthenticated, remote attacker first identifies a target application running a vulnerable version of Ruby on Rails on a Ruby interpreter older than version 3.2. The attacker then crafts a malicious HTTP request containing a query string with parameters designed to exploit the inefficient regular expression in the Action Dispatch filtering logic. Upon receiving the request, the Rails application attempts to process these parameters, triggering the ReDoS condition. The server's CPU usage for that worker process spikes to 100%, effectively freezing it. By repeating this process, the attacker can tie up all server resources, causing a denial of service.
How to fix it
The primary remediation is to upgrade the Ruby on Rails framework to a patched version. Depending on your current version, upgrade to one of the following or a later version: - Rails 6.1.x users should upgrade to 6.1.7.9. - Rails 7.0.x users should upgrade to 7.0.8.5. - Rails 7.1.x users should upgrade to 7.1.4.1. - Rails 7.2.x users should upgrade to 7.2.1.1. As a workaround or alternative mitigation, you can upgrade the underlying Ruby interpreter to version 3.2 or newer. Ruby 3.2 contains mitigations for this type of ReDoS vulnerability, rendering the application unaffected even with a vulnerable Rails version. For applications with downstream dependencies like Mattermost, ensure you upgrade to the version that incorporates the fix, such as 9.4.2 or newer for `mattermost-server`.
How to confirm the fix worked
To validate if your application is vulnerable, check the version of the `rails` gem specified in your `Gemfile.lock`. Compare this version against the fixed versions (6.1.7.9, 7.0.8.5, 7.1.4.1, 7.2.1.1). Additionally, check your Ruby interpreter version by running `ruby -v`. If the version is 3.2.0 or higher, you are not affected. To confirm the fix has been applied, ensure your `Gemfile.lock` reflects the patched `rails` version after running `bundle update rails` and redeploying your application.
Typical attack path
- Attacker identifies a public-facing web application built with a vulnerable version of Ruby on Rails.
- Attacker crafts an HTTP request with a malicious query string designed to trigger exponential backtracking in the regex engine during parameter filtering.
- Attacker sends the crafted request to any endpoint on the vulnerable application.
- The application's Action Dispatch component attempts to process the query parameters, leading to excessive CPU consumption and causing the worker process to hang.
- By repeating the request, the attacker exhausts all application server processes, making the application unavailable to legitimate users.
How to detect it
To detect potential exploitation attempts, monitor web server access logs, application logs, and Application Performance Monitoring (APM) data. Look for a correlation between incoming HTTP requests with unusually long or complex query strings and periods of sustained, high CPU utilization (e.g., 90-100%) on application servers. APM tools may highlight specific transactions with abnormally long response times, where the time is spent within the application code rather than in database or external service calls. Application server logs may also show worker processes timing out or being automatically restarted by a master process.
What your security team should do
- Identify all applications using Ruby on Rails within your environment and determine their framework and Ruby interpreter versions.
- Prioritize patching for public-facing and business-critical applications to mitigate the risk of service disruption.
- Apply the recommended Rails version upgrade as the primary remediation path.
- If a Rails upgrade is not immediately possible, evaluate upgrading the Ruby interpreter to version 3.2+ as a strong compensating control.
- Configure monitoring and alerting for sustained high CPU usage on Rails application servers, which could indicate an active exploitation attempt.
The record
Action Pack is a framework for handling and responding to web requests. Starting in version 3.1.0 and prior to versions 6.1.7.9, 7.0.8.5, 7.1.4.1, and 7.2.1.1, there is a possible ReDoS vulnerability in the query parameter filtering routines of Action Dispatch. Carefully crafted query parameters can cause query parameter filtering to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade to version 6.1.7.9, 7.0.8.5, 7.1.4.1, or 7.2.1.1 or apply the relevant patch immediately. One may use Ruby 3.2 as a workaround. Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| RubyGems | actionpack | 3.1.0 | 6.1.7.9 |
| RubyGems | actionpack | 7.0.0 | 7.0.8.5 |
| RubyGems | actionpack | 7.1.0 | 7.1.4.1 |
| RubyGems | actionpack | 7.2.0 | 7.2.1.1 |
| Bitnami | rails | 3.1.0 | 6.1.8 |
| Bitnami | rails | 3.1.0 | 7.2.2 |
| Bitnami | rails | 7.0.0 | 7.0.9 |
| Debian:11 | rails | 0 | No fix |
| Debian:12 | rails | 0 | No fix |
| Debian:12 | rails | 0 | 2:6.1.7.10+dfsg-1~deb12u1 |
| Debian:13 | rails | 0 | No fix |
| Debian:13 | rails | 0 | 2:7.2.2.1+dfsg-1 |
| Ubuntu:20.04:LTS | rails | 0 | No fix |
| Ubuntu:22.04:LTS | rails | 0 | No fix |
| Ubuntu:24.04:LTS | rails | 0 | No fix |
| Ubuntu:24.10 | rails | 0 | No fix |
| Ubuntu:25.04 | rails | 0 | No fix |
| Ubuntu:25.10 | rails | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | rails | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | rails | 0 | 2:4.2.6-1ubuntu0.1~esm1 |
| Ubuntu:Pro:18.04:LTS | rails | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | rails | 0 | 2:4.2.10-0ubuntu4+esm1 |
| Ubuntu:Pro:20.04:LTS | rails | 0 | 2:5.2.3+dfsg-3ubuntu0.1~esm1 |
| Ubuntu:Pro:22.04:LTS | rails | 0 | 2:6.1.4.1+dfsg-8ubuntu2+esm1 |
| gem | actionpack | 3.1.0 | 6.1.7.9 |
| gem | actionpack | 7.0.0 | 7.0.8.5 |
| gem | actionpack | 7.1.0 | 7.1.4.1 |
| gem | actionpack | 7.2.0 | 7.2.1.1 |
| openSUSE:Tumbleweed | rubygem-actionpack-7.0 | 0 | 7.0.8.6-1.1 |
| openSUSE:Tumbleweed | rubygem-actionpack-7.0 | 0 | 7.0.8.6-1.3 |
| openSUSE:Tumbleweed | rubygem-rails-7.0 | 0 | 7.0.8.6-1.1 |
| openSUSE:Tumbleweed | rubygem-rails-7.0 | 0 | 7.0.8.6-1.3 |
Related vulnerabilities
- CVE-2023-28362 The redirect_to method in Rails allows provided values to contain characters which are… Also affects actionpack
- CVE-2024-54133 Action Pack is a framework for handling and responding to web requests. Also affects actionpack
- CVE-2024-47887 Action Pack is a framework for handling and responding to web requests. Also affects actionpack
- CVE-2022-22577 An XSS Vulnerability in Action Pack >= 5.2.0 and < 5.2.0 that could allow an attacker to… Also affects actionpack
- CVE-2020-8166 A CSRF forgery vulnerability exists in rails < 5.2.5, rails < 6.0.4 that makes it… Also affects actionpack
- CVE-2016-2098 Action Pack in Ruby on Rails before 3.2.22.2, 4.x before 4.1.14.2, and 4.2.x before… Also affects actionpack
- CVE-2016-0752 Directory traversal vulnerability in Action View in Ruby on Rails before 3.2.22.1, 4.0.x… Also affects actionpack
- CVE-2014-0130 Directory traversal vulnerability in actionpack/lib/abstract_controller/base.rb in the… Also affects actionpack