# CVE-2025-61921: Sinatra has ReDoS vulnerability in ETag header value generation

> Attackers can cause denial of service in Sinatra applications using the etag method via crafted If-Match or If-None-Match headers.

- **Severity:** Low 2.7 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/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:** 10 Oct 2025
- **Updated:** 10 Oct 2025
- **Also known as:** CLEANSTART-2026-VS84759, DEBIAN-CVE-2025-61921, GHSA-mr3q-g2mv-mr4q, MINI-2f8v-qc34-5q3v, MINI-5fxm-34fj-4r3x, MINI-83c6-vmrq-xcpj, MINI-88ch-cxjq-f3fr, MINI-967v-x3q9-2f63, MINI-9cwm-4gf3-6rqg, MINI-cgc6-q47h-6597, MINI-g4q5-38vq-m34w, MINI-gq6j-78h2-9cjq, MINI-h8fv-r22m-9768, MINI-hgc6-543q-7c35, MINI-hrgh-mf9g-qr8v, MINI-j656-44vh-7wxj, MINI-jcjm-9xg5-qjjx, MINI-pgf9-6cv7-f8hw, MINI-pvfp-9cg4-58rg, MINI-rch4-4qmx-fv7x, MINI-rgrx-cx9r-gcpx, MINI-wrmp-9qv2-6m63, MINI-x5cw-mrx7-c6hc, UBUNTU-CVE-2025-61921

## What is CVE-2025-61921?

CVE-2025-61921 is a low-severity denial of service vulnerability in sinatra, published on 10 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Sinatra is a domain-specific language for creating web applications in Ruby. In versions prior to 4.2.0, there is a denial of service vulnerability in the `If-Match` and `If-None-Match` header parsing component of Sinatra, if the `etag` method is used when constructing the response. Carefully crafted input can cause `If-Match` and `If-None-Match` header parsing in Sinatra to take an unexpected amount of time, possibly resulting in a denial of service attack vector. This header is typically involved in generating the `ETag` header value. Any applications that use the `etag` method when generating a response are impacted. Version 4.2.0 fixes the issue.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity)

## Which versions are affected by CVE-2025-61921?

2 open source packages ship an affected version, including sinatra. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sinatra` | RubyGems | All versions | 4.2.0 |
| `sinatra` | RubyGems | All versions | 4.2.0 |

Products: Sinatrarb Sinatra.

## How do I fix CVE-2025-61921?

Upgrade sinatra to 4.2.0 or later.

## Is CVE-2025-61921 being exploited?

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

## Other vulnerabilities in sinatra

- [CVE-2018-7212](https://insights.sbomify.com/CVE-2018-7212/): Sinatra Path Traversal vulnerability (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-61921 and fix it if it is affected.

What it is: CVE-2025-61921 is a low-severity denial of service vulnerability in sinatra, published on 10 Oct 2025. 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-2025-61921 in the wild and no public exploit code.

Affected packages and fixed versions:
- sinatra (RubyGems): affected all versions; fixed in 4.2.0
- sinatra (RubyGems): affected all versions; fixed in 4.2.0

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-2025-61921/ (Markdown: https://insights.sbomify.com/CVE-2025-61921/index.md)
```

## Sources

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

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