CVE-2025-61921 — Vulnerability in sinatra — CVE Details
Sinatra is vulnerable to ReDoS through ETag header value generation
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.87%). Schedule for your next planned update.
Does your project use an affected sinatra version?
Paste your Gemfile.lock to check it for CVE-2025-61921 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
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 and you are using Ruby < 3.2.
Details
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 if they are using Ruby below version 3.2.
Resources
- https://github.com/sinatra/sinatra/issues/2120 (report)
- https://github.com/sinatra/sinatra/pull/2121 (fix)
- https://github.com/sinatra/sinatra/pull/1823 (older ReDoS vulnerability)
- https://bugs.ruby-lang.org/issues/19104 (fix in Ruby >= 3.2)
Advisory Timeline
- First published October 10, 2025 (413 days ago).
- Last revised September 10, 2026 — 334 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install sinatra -v 4.2.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| sinatra RubyGems · Affected: 0.1.0, 0.1.5, 0.1.6, 0.1.7 (+102 more) | 4.2.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-1333
- CWE-400Uncontrolled Resource ConsumptionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 5.3 score means for each attack dimension.
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
References
- https://github.com/sinatra/sinatra/security/advisories/GHSA-mr3q-g2mv-mr4qWEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-61921ADVISORY
- https://github.com/sinatra/sinatra/issues/2120WEB
- https://github.com/sinatra/sinatra/pull/1823WEB
- https://github.com/sinatra/sinatra/pull/2121WEB
- https://github.com/sinatra/sinatra/commit/3fe8c38dc405586f7ad8f2ac748aa53e9c3615bdWEB
- https://github.com/sinatra/sinatra/commit/8ff496bd4877520599e1479d6efead39304edcebWEB
- https://bugs.ruby-lang.org/issues/19104WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sinatra/CVE-2025-61921.ymlWEB
- https://github.com/sinatra/sinatraPACKAGE
Frequently Asked Questions
- What is CVE-2025-61921?
- Sinatra is vulnerable to ReDoS through ETag header value generation. This vulnerability has been assigned a severity rating of LOW (CVSS score: 5.3/10).
- How do I check if my project is affected by CVE-2025-61921?
- CVE-2025-61921 affects sinatra. It has a 0.9% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-61921 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is an above-median EPSS score — 56.4% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2022-45442HIGH
Sinatra vulnerable to Reflected File Download attack
- CVE-2022-29970HIGH
sinatra does not validate expanded path matches
- CVE-2024-21510MEDIUM
Sinatra vulnerable to Reliance on Untrusted Inputs in a Security Decision
- CVE-2018-11627MEDIUM
Sinatra Cross-site Scripting vulnerability
- CVE-2026-126063LOW
Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer
- CVE-2026-54620LOW
sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks