# CVE-2024-26142: Rails possible ReDoS vulnerability in Accept header parsing in Action Dispatch


- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 27 Feb 2024
- **Updated:** 13 Feb 2025
- **Also known as:** BIT-rails-2024-26142, GHSA-jjhx-jhvp-74wq, UBUNTU-CVE-2024-26142

## What is CVE-2024-26142?

CVE-2024-26142 is a high-severity vulnerability in Rubyonrails Rails, published on 27 Feb 2024. 

### Official description

Rails is a web-application framework. Starting in version 7.1.0, there is a possible ReDoS vulnerability in the Accept header parsing routines of Action Dispatch. This vulnerability is patched in 7.1.3.1. Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity)

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

3 open source packages ship an affected version, including rails and actionpack. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rails` | Bitnami | From 7.1.0 | 7.1.4 |
| `actionpack` | RubyGems | From 7.1.0 | 7.1.3.1 |
| `actionpack` | RubyGems | From 7.1.0 | 7.1.3.1 |

Products: Rubyonrails Rails.

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

Upgrade rails to 7.1.4 or later.

## Is CVE-2024-26142 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-26142 exists.

## Other vulnerabilities in Rubyonrails Rails

- [CVE-2013-0277](https://insights.sbomify.com/CVE-2013-0277/): Active Record contains deserialization of arbitrary YAML (critical 10.0)
- [CVE-2017-17916](https://insights.sbomify.com/CVE-2017-17916/): SQL injection in n/a (high 8.1)
- [CVE-2017-17917](https://insights.sbomify.com/CVE-2017-17917/): SQL injection in n/a (high 8.1)
- [CVE-2026-33195](https://insights.sbomify.com/CVE-2026-33195/): Rails Active Storage has possible Path Traversal in DiskService (high 8.0)
- [CVE-2023-22792](https://insights.sbomify.com/CVE-2023-22792/): ReDoS based DoS vulnerability in Action Dispatch (high 7.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-26142 is a high-severity vulnerability in Rubyonrails Rails, published on 27 Feb 2024. 
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-26142 exists.

Affected packages and fixed versions:
- rails (Bitnami): affected from 7.1.0; fixed in 7.1.4
- actionpack (RubyGems): affected from 7.1.0; fixed in 7.1.3.1
- actionpack (RubyGems): affected from 7.1.0; fixed in 7.1.3.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-26142/ (Markdown: https://insights.sbomify.com/CVE-2024-26142/index.md)
```

## Sources

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

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