Skip to main content

Sinatra CVE-2025-61921

LOW
Inefficient Regular Expression Complexity (ReDoS) (CWE-1333)
2025-10-10 security-advisories@github.com
2.7
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send request with crafted If-None-Match header
  2. Exploit
    Trigger catastrophic regex backtracking in ETag parsing
  3. Impact
    Exhaust CPU and degrade availability

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Regex complexity limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three concrete conditions to all hold: (1) the application must call Sinatra's etag method when constructing a response, which drives parsing of client-supplied If-Match / If-None-Match headers; (2) the underlying Ruby runtime must be below version 3.2, since Ruby 3.2+ fixed the regex engine behavior (bugs.ruby-lang.org/issues/19104) that enables the catastrophic backtracking; and (3) the attacker must reach the affected endpoint with a controlled If-Match/If-None-Match header. Limiting factors: applications on Ruby >= 3.2 are not affected even on vulnerable Sinatra versions, and applications that never use etag are not impacted - so despite the unauthenticated network vector, realistic exposure is confined to older-Ruby deployments using ETag generation.

Impact

This is a low-severity, low-priority issue despite being network-reachable and unauthenticated. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) describes remote, low-complexity, unauthenticated reachability, but the only impact is VA:L - a partial, bounded availability degradation (ReDoS CPU consumption), with no confidentiality or integrity impact (VC:N/VI:N) - yielding the low base score of 2.7. EPSS is modest at 0.50% (41st percentile), consistent with a low-impact DoS that is not an attractive mass-exploitation target. There is NO CISA KEV listing, so exploitation status is: no public exploit identified at time of analysis - note that although the input marks a reference as 'exploit', that reference (PR 1823) is actually the fix for an OLDER, separate ReDoS issue per the GHSA advisory, not weaponized exploit code for this CVE, so POC availability for CVE-2025-61921 specifically is not substantiated by the provided evidence. Signals are therefore consistent (low CVSS + low EPSS + no KEV = genuinely low real-world risk), with one important caveat the NVD data omits: the GHSA advisory states exploitation requires Ruby < 3.2, which substantially narrows the exposed population versus what the NVD description implies.

Exploit ScenarioDerived

A remote, unauthenticated attacker sends an HTTP request containing a specially crafted If-Match or If-None-Match header to a public Sinatra endpoint whose handler calls the etag method while running on Ruby < 3.2. The pathological input triggers catastrophic regular-expression backtracking during header parsing, consuming excessive CPU and degrading or temporarily denying service. No confirmed working PoC for this specific CVE is provided (the referenced 'exploit' link is a fix for an earlier, distinct ReDoS).

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 19, 2026

Denial of service in Sinatra versions prior to 4.2.0 allows unauthenticated remote attackers to consume excessive CPU time by sending crafted If-Match or If-None-Match headers to endpoints that call the etag helper, potentially degrading availability. Exploitation is constrained: the application must use the etag method and run on Ruby below 3.2, because Ruby 3.2+ corrected the regex behavior that enables catastrophic backtracking. Publicly available exploit code exists and EPSS is approximately 0.5% at the 41st percentile; the issue is not in CISA KEV. Assessed severity is low, with CVSS 3.1 vector AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.

RemediationAI

Upgrade Sinatra to 4.2.0, the vendor-released patch version, as documented in GHSA-mr3q-g2mv-mr4q and fixed by PR https://github.com/sinatra/sinatra/pull/2121. If upgrading is not immediately possible, move the application to Ruby 3.2 or later, which fixes the underlying regex behavior referenced in https://bugs.ruby-lang.org/issues/19104, or stop using the etag helper and filter or cap client-supplied If-Match and If-None-Match headers at a reverse proxy; the Ruby upgrade requires compatibility testing, disabling etag loses HTTP caching benefits, and header filtering may break legitimate conditional requests. Public exploit code is available, EPSS is low at roughly 0.5% at the 41st percentile, and the issue is not known to be actively exploited in CISA KEV. Patch status: Vendor-released patch: 4.2.0.

Affected Packages

rubygems sinatra fix: 4.2.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in rubygems

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Sinatra is a Ruby domain-specific language for building web applications. Its etag helper generates an ETag response header, and the framework parses client-supplied If-Match and If-None-Match headers to evaluate conditional requests. In affected versions, the header parsing uses a regular expression vulnerable to inefficient regular expression complexity (CWE-1333), so crafted header values can trigger catastrophic backtracking and excessive CPU consumption. The flaw is only exploitable on Ruby versions below 3.2; Ruby 3.2 addressed the underlying regex engine behavior in bugs.ruby-lang.org/issues/19104. Sinatra 4.2.0 contains the parsing fix in PR 2121, while PR 1823 corresponds to an earlier ReDoS hardening effort. The CPE cpe:2.3:a:sinatrarb:sinatra:*:*:*:*:*:*:*:* covers Sinatra releases before 4.2.0.

Know when Sinatra gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 2.7 LOW
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
vuln.today AI 5.3 MEDIUM

Remotely reachable via unauthenticated HTTP headers with low complexity (AV:N/AC:L/PR:N/UI:N); only bounded availability degradation (A:L) with no confidentiality or integrity impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.5%
Top 59% exploitable
Prevalence
Medium
popular lightweight Ruby web framework, narrower footprint than Rails
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Low

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +14
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

cpe:2.3:a:sinatrarb:sinatra:*:*:*:*:*:*:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy