CVE-2024-21510
JSON

5.4medium

Sinatra vulnerable to Reliance on Untrusted Inputs in a Security Decision

Severity
5.4medium CVSS:3.1 by snyk
Exploit likelihood
0.49% (higher than 43% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
snyk
Also known as
GHSA-hxx2-7vcw-mqr3

Description

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.

Affected

Product or packageVersionsReported by
sinatrafrom 0.0.0 before *CVE List
sinatra (RubyGems)before 4.1.0GitHub Advisory Database

All scores

snyk5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N/E:P
GitHub5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Classification

CWE-807

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Las versiones del paquete sinatra a partir de la versión 0.0.0 son vulnerables a la dependencia de entradas no confiables en una decisión de seguridad a través del encabezado X-Forwarded-Host (XFH). Al realizar una solicitud a un método con redirección aplicada, es posible desencadenar un ataque de redirección abierta insertando una dirección arbitraria en este encabezado. Si se utiliza con fines de almacenamiento en caché, como con servidores como Nginx, o como un proxy inverso, sin manejar el encabezado X-Forwarded-Host, los atacantes pueden explotar potencialmente el envenenamiento de caché o SSRF basada en enrutamiento.

References

https://security.snyk.io/vuln/SNYK-RUBY-SINATRA-6483832web
https://github.com/sinatra/sinatra/blob/b626e2d82c23b4fde0b51782fd32ca27ccde1d1a/lib/sinatra/base.rb%23L319
https://github.com/sinatra/sinatra/blob/b626e2d82c23b4fde0b51782fd32ca27ccde1d1a/lib/sinatra/base.rb%23L323C1-L343C17
https://github.com/sinatra/sinatra/pull/2010web
https://nvd.nist.gov/vuln/detail/CVE-2024-21510advisory
https://github.com/advisories/GHSA-hxx2-7vcw-mqr3advisory
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sinatra/CVE-2024-21510.ymlweb
https://github.com/sinatra/sinatrapackage
https://github.com/sinatra/sinatra/blob/b626e2d82c23b4fde0b51782fd32ca27ccde1d1a/lib/sinatra/base.rb#L319web
https://github.com/sinatra/sinatra/blob/b626e2d82c23b4fde0b51782fd32ca27ccde1d1a/lib/sinatra/base.rb#L323C1-L343C17web
https://github.com/sinatra/sinatra/blob/main/CHANGELOG.md#410--2024-11-18web

Sources

SourceRecordLicence
CVE ListCVE-2024-21510 changed 2024-11-18CVE Terms of Use
GitHub Advisory DatabaseGHSA-hxx2-7vcw-mqr3 changed 2026-09-10CC-BY-4.0
NVDCVE-2024-21510 changed 2026-06-17Public domain