CVE-2024-47889
NoneCVSS
—
EPSS
0.9%
Published
Oct 16, 2024
CISA due date
—
Cloudanix analysis
A flaw in some Rails email-formatting code can let someone slow down or disrupt an application by submitting specially crafted text.
- 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
This vulnerability is a regular expression denial-of-service issue in Action Mailer's `block_format` helper in affected Ruby on Rails releases starting with 3.0.0 and before 6.1.7.9, 7.0.8.5, 7.1.4.1, and 7.2.1.1. If attacker-controlled text is passed to `block_format`, specially crafted input can trigger excessive regex backtracking and consume CPU for an unexpectedly long time. The impact is availability-focused: it does not provide code execution, data disclosure, or privilege escalation, but it can tie up application worker threads or processes and degrade or interrupt service.
Why it matters to the business
Applications that render attacker-supplied content into emails using Action Mailer may experience slowdowns, request timeouts, delayed email delivery, exhausted web or background worker capacity, and degraded customer-facing functionality. The issue is not listed in CISA KEV, has no known ransomware association, and has low EPSS probability, but exploitation is network-reachable and unauthenticated when exposed through public forms, signup flows, contact forms, support workflows, notification systems, or any feature that sends formatted email from user input.
How an attack unfolds
An attacker first identifies a Rails application workflow that accepts text and later formats that text into an email using Action Mailer's `block_format` helper. Common candidates include contact forms, comment notifications, invitation messages, support tickets, feedback forms, and account-related email templates. The attacker submits carefully crafted text designed to trigger pathological regex behavior in the helper. When the application generates the email, the vulnerable formatting logic spends excessive CPU time processing the input. Repeated submissions can tie up application workers or background job processors, causing request latency, job backlog, email delivery delays, health check failures, autoscaling events, or service unavailability. There is no indication from the provided data that public exploit code, active KEV exploitation, ransomware use, or named threat actor activity is associated with this vulnerability.
How to fix it
Upgrade Rails to a fixed release: 6.1.7.9, 7.0.8.5, 7.1.4.1, 7.2.1.1, or later. For source builds, include the Rails fix commit `b2fbbfbcaa3d662c68a9ee21ab6cf95eccc2b4ec`. If immediate upgrade is not possible, avoid calling `block_format` on attacker-controlled input, remove or replace the helper in email templates, validate and cap the size of free-form text fields used in emails, and enforce request/job execution timeouts. Applications running Ruby 3.2 or newer are described as unaffected because Ruby 3.2 includes mitigations for this regex behavior; Rails 8.0.0.beta1 and later requiring Ruby 3.2 or newer are also described as unaffected. Treat the listed Go stdlib 1.21.8 fixed version as package metadata only unless Go components independently rely on affected regex behavior; this specific vulnerability description concerns Rails Action Mailer.
How to confirm the fix worked
Confirm the deployed Rails version is 6.1.7.9, 7.0.8.5, 7.1.4.1, 7.2.1.1, or later, or that the fix commit `b2fbbfbcaa3d662c68a9ee21ab6cf95eccc2b4ec` is present in source builds. Check dependency manifests and lockfiles such as `Gemfile.lock` for the installed `actionmailer` and Rails versions. Confirm production runtime Ruby is 3.2 or newer if relying on the Ruby runtime mitigation. Search application mailer views and helpers for `block_format` usage, especially where arguments can contain user-supplied text. Validate operationally by exercising email-rendering workflows with bounded test input and confirming mail rendering completes within expected timeouts without abnormal CPU spikes.
Typical attack path
- Identify a Rails application running an affected Action Mailer version.
- Find an unauthenticated or low-friction feature that accepts free-form text and sends or previews email.
- Submit crafted text intended to cause excessive processing in the `block_format` helper.
- Trigger the mail rendering path through the web request or a queued background job.
- Repeat requests or submissions to consume web worker, application server, or job processor CPU.
- Cause degraded performance, request timeouts, delayed email processing, or temporary denial of service.
How to detect it
To assess whether exploitation already occurred, review web access logs, application logs, background job logs, APM traces, and infrastructure metrics for periods of unusually high CPU, slow request completion, request timeouts, worker restarts, or mail queue backlogs tied to email-generating workflows. Focus on endpoints or jobs that accept free-form text and trigger Action Mailer templates using `block_format`, such as contact, feedback, support, invitation, notification, comment, or account-message flows. Look for repeated submissions from the same source IPs or user agents followed by long mail-rendering durations, job retries, timeout exceptions, health check failures, or autoscaling events. Since the vulnerability is input-pattern dependent and no public exploit signature is provided in the input, detection should emphasize behavioral indicators rather than fixed payload strings.
What your security team should do
- Prioritize upgrades for internet-facing Rails applications that accept free-form user input and generate emails from that input.
- Inventory Rails applications and identify affected `actionmailer` versions below 6.1.7.9, 7.0.8.5, 7.1.4.1, and 7.2.1.1.
- Search codebases for `block_format` and review whether attacker-controlled text can reach the helper.
- Apply fixed Rails versions or the upstream patch; alternatively move affected applications to Ruby 3.2 or newer where feasible.
- Add size limits, rate limits, and execution timeouts around email-generation flows and background mail jobs.
- Monitor for repeated long-running requests, mailer job timeouts, elevated CPU, and queue buildup associated with email rendering.
- Because this is not KEV-listed, has no known ransomware use, and has low EPSS, handle as a targeted availability-risk patching item rather than an emergency exploitation campaign unless local telemetry shows abuse.
The record
Action Mailer is a framework for designing email service layers. Starting in version 3.0.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 block_format helper in Action Mailer. Carefully crafted text can cause the block_format helper to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade to versions 6.1.7.9, 7.0.8.5, 7.1.4.1, or 7.2.1.1 or apply the relevant patch immediately. As a workaround, users can avoid calling the `block_format` helper or upgrade to Ruby 3.2. Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 requires Ruby 3.2 or greater so is unaffected.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| RubyGems | actionmailer | 3.0.0 | 6.1.7.9 |
| RubyGems | actionmailer | 7.0.0 | 7.0.8.5 |
| RubyGems | actionmailer | 7.1.0 | 7.1.4.1 |
| RubyGems | actionmailer | 7.2.0 | 7.2.1.1 |
| Bitnami | rails | 3.0.0 | 6.1.8 |
| Bitnami | rails | 3.0.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 |
| SUSE:Linux Enterprise High Availability Extension 15 SP2 | rubygem-actionmailer-5_1 | 0 | 5.1.4-150000.3.3.1 |
| SUSE:Linux Enterprise High Availability Extension 15 SP3 | rubygem-actionmailer-5_1 | 0 | 5.1.4-150000.3.3.1 |
| SUSE:Linux Enterprise High Availability Extension 15 SP4 | rubygem-actionmailer-5_1 | 0 | 5.1.4-150000.3.3.1 |
| SUSE:Linux Enterprise High Availability Extension 15 SP5 | rubygem-actionmailer-5_1 | 0 | 5.1.4-150000.3.3.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 | actionmailer | 3.0.0 | 6.1.7.9 |
| gem | actionmailer | 7.0.0 | 7.0.8.5 |
| gem | actionmailer | 7.1.0 | 7.1.4.1 |
| gem | actionmailer | 7.2.0 | 7.2.1.1 |
| openSUSE:Tumbleweed | rubygem-actionmailer-7.0 | 0 | 7.0.8.6-1.1 |
| openSUSE:Tumbleweed | rubygem-actionmailer-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-2024-54133 Action Pack is a framework for handling and responding to web requests. Also affects rails
- CVE-2024-47888 Action Text brings rich text content and editing to Rails. Also affects rails
- CVE-2024-47887 Action Pack is a framework for handling and responding to web requests. Also affects rails
- CVE-2024-41128 Action Pack is a framework for handling and responding to web requests. Also affects rails
- CVE-2025-55193 Active Record connects classes to relational database tables. Also affects rails
- CVE-2023-28120 There is a vulnerability in ActiveSupport if the new bytesplice method is called on a… Also affects rails
- CVE-2023-23913 There is a potential DOM based cross-site scripting issue in rails-ujs which leverages… Also affects rails
- CVE-2023-28362 The redirect_to method in Rails allows provided values to contain characters which are… Also affects rails