HighGHSA-2x8x-jmrp-phxwCVE-2022-45442
Sinatra vulnerable to Reflected File Download attack
Published 30 Nov 2022 · Updated 4 Feb 2026
Is your project on an affected sinatra?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
sinatraRubyGems
- Affected
- >=3.0 <3.0.4
- Fixed in
- 3.0.4
Update to the fixed version for your release line, for example:
bundle update --conservative sinatra # Gemfile: '>= 3.0.4'sinatraRubyGems
- Affected
- >=2.0.0 <2.2.3
- Fixed in
- 2.2.3
Update to the fixed version for your release line, for example:
bundle update --conservative sinatra # Gemfile: '>= 2.2.3'Details
Description
An issue was discovered in Sinatra 2.0 before 2.2.3 and 3.0 before 3.0.4. An application is vulnerable to a reflected file download (RFD) attack that sets the Content-Disposition header of a response when the filename is derived from user-supplied input.
References
- https://www.blackhat.com/docs/eu-14/materials/eu-14-Hafif-Reflected-File-Download-A-New-Web-Attack-Vector.pdf
- https://github.com/advisories/GHSA-8x94-hmjh-97hq
Is GHSA-2x8x-jmrp-phxw in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected sinatra, and gives you the command that fixes it.
More advisories for sinatra
- LowCVE-2025-61921Sinatra is vulnerable to ReDoS through ETag header value generation · 10 Oct 2025
- MediumCVE-2024-21510Sinatra vulnerable to Reliance on Untrusted Inputs in a Security Decision · 1 Nov 2024
- HighCVE-2022-29970sinatra does not validate expanded path matches · 3 May 2022
- MediumCVE-2018-11627Sinatra Cross-site Scripting vulnerability · 5 Jun 2018
- MediumCVE-2018-7212Sinatra Path Traversal vulnerability · 20 Feb 2018
References
- Linkgithub.com/sinatra/sinatra/security/advisories/GHSA-2x8x-jmrp-phxw
- Advisorynvd.nist.gov/vuln/detail/CVE-2022-45442
- Linkgithub.com/sinatra/sinatra/commit/ea8fc9495a350f7551b39e3025bfcd06f49f363b
- Advisorygithub.com/advisories/GHSA-8x94-hmjh-97hq
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/sinatra/CVE-2022-45442.yml
- Packagegithub.com/sinatra/sinatra
- Linklists.debian.org/debian-lts-announce/2023/01/msg00005.html
- Linklists.debian.org/debian-lts-announce/2024/09/msg00020.html
- Linkwww.blackhat.com/docs/eu-14/materials/eu-14-Hafif-Reflected-File-Download-A-New-Web-Attack-Vector.pdf
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.