CVE-2024-21510: Sinatra Sinatra Vulnerable To Reliance On Vulnerability

MODERATE
Advisory Identifier: GHSA-hxx2-7vcw-mqr3
CVSS 5.4
CWE-807
Published
Advisory Summary

CVE-2024-21510 is a MODERATE (CVSS 5.4) sinatra vulnerable to reliance on vulnerability (CWE-807: Reliance on Untrusted Inputs in a Security Decision) affecting Sinatra libraries in the RubyGems ecosystem. The issue involves sinatra vulnerable to reliance on untrusted inputs in a security decision. Remediation is available by upgrading affected packages to version 4.1.0.

CVE-2024-21510 at a Glance

CVE Identifier CVE-2024-21510
GHSA Identifier GHSA-hxx2-7vcw-mqr3
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-807: Reliance on Untrusted Inputs in a Security Decision
Affected Product Sinatra
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-21510

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.

sinatra fixed: 4.1.0
Upgrade sinatra to 4.1.0
Verify Direct and Transitive Dependencies

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-2024-21510, 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.1.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-807: Reliance on Untrusted Inputs in a Security Decision, where the product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism. 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

Versions of the package sinatra from 0.0.0 are vulnerable to Reliance on Untrusted Inputs in a Security Decision via the X-Forwarded-Host (XFH) header. When making a request to a method with redirect applied, it is possible to trigger an Open Redirect Attack by inserting an arbitrary address into this header. If used for caching purposes, such as with servers like Nginx, or as a reverse proxy, without handling the X-Forwarded-Host header, attackers can potentially exploit Cache Poisoning or Routing-based SSRF.

CVE-2024-21510 Affected Sinatra Versions

1 component(s)
Fixed Versions:
4.1.0
Product / Package Ecosystem Affected Versions Fixed Version
sinatra
RubyGems
< 4.1.0
4.1.0

References

Frequently Asked Questions

What is CVE-2024-21510?
CVE-2024-21510 is a security vulnerability in Sinatra involving Sinatra vulnerable to Reliance on Untrusted Inputs in a Security Decision under CWE-807: Reliance on Untrusted Inputs in a Security Decision.
Which Sinatra versions are affected?
Affected versions include releases prior to 4.1.0 across affected packages: sinatra.
What version fixes CVE-2024-21510?
Upgrading to 4.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sinatra affected?
Yes, sinatra is affected in releases prior to 4.1.0. Upgrade your dependency to 4.1.0 or later.
What is the CVSS score of CVE-2024-21510?
CVE-2024-21510 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2024-21510?
CVE-2024-21510 is classified under CWE-807: Reliance on Untrusted Inputs in a Security Decision (The product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism.).
How can I check RubyGems dependencies for CVE-2024-21510?
Run the dependency tree command: 'inspect dependencies for sinatra'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hxx2-7vcw-mqr3",
  "modified" : "2024-11-20T16:38:35Z",
  "published" : "2024-11-01T06:30:34Z",
  "aliases" : [ "CVE-2024-21510" ],
  "summary" : "Sinatra vulnerable to Reliance on Untrusted Inputs in a Security Decision",
  "details" : "Versions of the package sinatra from 0.0.0 are vulnerable to Reliance on Untrusted Inputs in a Security Decision via the X-Forwarded-Host (XFH) header. When making a request to a method with redirect applied, it is possible to trigger an Open Redirect Attack by inserting an arbitrary address into this header. If used for caching purposes, such as with servers like Nginx, or as a reverse proxy, without handling the X-Forwarded-Host header, attackers can potentially exploit Cache Poisoning or Routing-based SSRF.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "sinatra"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21510"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sinatra/sinatra/pull/2010"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-hxx2-7vcw-mqr3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sinatra/CVE-2024-21510.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sinatra/sinatra"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sinatra/sinatra/blob/b626e2d82c23b4fde0b51782fd32ca27ccde1d1a/lib/sinatra/base.rb#L319"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sinatra/sinatra/blob/b626e2d82c23b4fde0b51782fd32ca27ccde1d1a/lib/sinatra/base.rb#L323C1-L343C17"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sinatra/sinatra/blob/main/CHANGELOG.md#410--2024-11-18"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-RUBY-SINATRA-6483832"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-807" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-01T21:37:42Z",
    "nvd_published_at" : "2024-11-01T05:15:05Z"
  }
}