CVE-2025-61921: Sinatra Denial of Service Vulnerability
LOWCVE-2025-61921 is a LOW denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Sinatra libraries in the RubyGems ecosystem. The issue involves sinatra is vulnerable to redos through etag header value generation. Remediation is available by upgrading affected packages to version 4.2.0.
CVE-2025-61921 at a Glance
How to Fix CVE-2025-61921
To remediate this vulnerability, upgrade all affected Sinatra dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade sinatra to 4.2.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for sinatra
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-61921, inspect your project dependencies for Sinatra:
inspect dependencies for sinatra
Analyze the terminal output to locate any version of Sinatra in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Sinatra, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-61921 Affected Sinatra Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sinatra
|
RubyGems |
< 4.2.0
|
4.2.0
|
References
Frequently Asked Questions
What is CVE-2025-61921?
Which Sinatra versions are affected?
What version fixes CVE-2025-61921?
Is sinatra affected?
What CWE is associated with CVE-2025-61921?
How can I check RubyGems dependencies for CVE-2025-61921?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mr3q-g2mv-mr4q",
"modified" : "2025-10-13T15:46:28Z",
"published" : "2025-10-10T20:28:47Z",
"aliases" : [ "CVE-2025-61921" ],
"summary" : "Sinatra is vulnerable to ReDoS through ETag header value generation",
"details" : "### Summary\n\nThere 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.\n\n### Details\n\nCarefully 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.\n\n### Resources\n\n* https://github.com/sinatra/sinatra/issues/2120 (report)\n* https://github.com/sinatra/sinatra/pull/2121 (fix)\n* https://github.com/sinatra/sinatra/pull/1823 (older ReDoS vulnerability)\n* https://bugs.ruby-lang.org/issues/19104 (fix in Ruby >= 3.2)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "sinatra"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sinatra/sinatra/security/advisories/GHSA-mr3q-g2mv-mr4q"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-61921"
}, {
"type" : "WEB",
"url" : "https://github.com/sinatra/sinatra/issues/2120"
}, {
"type" : "WEB",
"url" : "https://github.com/sinatra/sinatra/pull/1823"
}, {
"type" : "WEB",
"url" : "https://github.com/sinatra/sinatra/pull/2121"
}, {
"type" : "WEB",
"url" : "https://github.com/sinatra/sinatra/commit/3fe8c38dc405586f7ad8f2ac748aa53e9c3615bd"
}, {
"type" : "WEB",
"url" : "https://github.com/sinatra/sinatra/commit/8ff496bd4877520599e1479d6efead39304edceb"
}, {
"type" : "WEB",
"url" : "https://bugs.ruby-lang.org/issues/19104"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sinatra/CVE-2025-61921.yml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sinatra/sinatra"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333", "CWE-400" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2025-10-10T20:28:47Z",
"nvd_published_at" : "2025-10-10T20:15:38Z"
}
}