# CVE-2024-47888: Action Text has possible ReDoS vulnerability in plain_text_for_blockquote_node

> Attackers can cause denial of service in Rails applications via crafted text triggering ReDoS in Action Text blockquote processing.

- **Severity:** Medium 6.6 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 16 Oct 2024
- **Updated:** 16 Oct 2024
- **Also known as:** BIT-rails-2024-47888, DEBIAN-CVE-2024-47888, GHSA-wwhv-wxv9-rpgw, UBUNTU-CVE-2024-47888, openSUSE-SU-2024:14473-1

## What is CVE-2024-47888?

CVE-2024-47888 is a medium-severity denial of service vulnerability in rails, published on 16 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Action Text brings rich text content and editing to Rails. Starting in version 6.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 `plain_text_for_blockquote_node helper` in Action Text. Carefully crafted text can cause the `plain_text_for_blockquote_node` 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 `plain_text_for_blockquote_node` 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 depends on Ruby 3.2 or greater so is unaffected.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity)

## Which versions are affected by CVE-2024-47888?

9 open source packages ship an affected version, including rails and actiontext.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rails` | Bitnami | From 6.0.0 | 6.1.8, 7.0.9, 7.1.4, 7.2.2 |
| `actiontext` | RubyGems | From 6.0.0 | 6.1.7.9 |
| `actiontext` | RubyGems | From 6.0.0 | 6.1.7.9 |
| `actiontext` | RubyGems | From 7.0.0 | 7.0.8.5 |
| `actiontext` | RubyGems | From 7.0.0 | 7.0.8.5 |
| `actiontext` | RubyGems | From 7.1.0 | 7.1.4.1 |
| `actiontext` | RubyGems | From 7.1.0 | 7.1.4.1 |
| `actiontext` | RubyGems | From 7.2.0 | 7.2.1.1 |
| `actiontext` | RubyGems | From 7.2.0 | 7.2.1.1 |
| `rubygem-actiontext-7.0` | openSUSE:Tumbleweed | All versions | 7.0.8.6-1.1 |

## How do I fix CVE-2024-47888?

Upgrade rails to a fixed version for your release line: 6.1.8, 7.0.9, 7.1.4 or 7.2.2.

## Is CVE-2024-47888 being exploited?

There is no known exploitation of CVE-2024-47888 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-47888 and fix it if it is affected.

What it is: CVE-2024-47888 is a medium-severity denial of service vulnerability in rails, published on 16 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-47888 in the wild and no public exploit code.

Affected packages and fixed versions:
- rails (Bitnami): affected from 6.0.0; fixed in 6.1.8, 7.0.9, 7.1.4, 7.2.2
- actiontext (RubyGems): affected from 6.0.0; fixed in 6.1.7.9
- actiontext (RubyGems): affected from 6.0.0; fixed in 6.1.7.9
- actiontext (RubyGems): affected from 7.0.0; fixed in 7.0.8.5
- actiontext (RubyGems): affected from 7.0.0; fixed in 7.0.8.5
- actiontext (RubyGems): affected from 7.1.0; fixed in 7.1.4.1
- actiontext (RubyGems): affected from 7.1.0; fixed in 7.1.4.1
- actiontext (RubyGems): affected from 7.2.0; fixed in 7.2.1.1
- actiontext (RubyGems): affected from 7.2.0; fixed in 7.2.1.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-47888/ (Markdown: https://insights.sbomify.com/CVE-2024-47888/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-47888
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-47888
- OSV: https://osv.dev/vulnerability/CVE-2024-47888

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-47888/
Summaries are generated and may contain mistakes; the official description above is the record.
