Vulnerabilities in pkg:gem/sinatra
PACKAGECVE-2022-45442 is a HIGH (CVSS 8.8) sinatra vulnerable to reflected file vulnerability (CWE-494: Download of Code Without Integrity Check) affecting Sinatra libraries in the RubyGems ecosystem. The issue involves sinatra vulnerable to reflected file download attack. Remediation is available by upgrading affected packages to version 3.0.4, 2.2.3.
pkg:gem/sinatra
Vulnerability advisories affecting package pkg:gem/sinatra. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-2x8x-jmrp-phxw | CVE-2022-45442 | HIGH | Sinatra vulnerable to Reflected File Download attack |
| GHSA-qp49-3pvw-x4m5 | CVE-2022-29970 | HIGH | sinatra does not validate expanded path matches |
| GHSA-mr3q-g2mv-mr4q | CVE-2025-61921 | LOW | Sinatra is vulnerable to ReDoS through ETag header value generation |
| GHSA-hxx2-7vcw-mqr3 | CVE-2024-21510 | MODERATE | Sinatra vulnerable to Reliance on Untrusted Inputs in a Security Decision |
| GHSA-mq35-wqvf-r23c | CVE-2018-11627 | MODERATE | Sinatra Cross-site Scripting vulnerability |
| GHSA-h29f-7f56-j8wh | CVE-2018-7212 | MODERATE | Sinatra Path Traversal vulnerability |
CVE-2022-45442 at a Glance
Security Impact
CVSS: 8.8
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:H/I:H/A:H).
How to Fix CVE-2022-45442
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 3.0.4
Upgrade sinatra to 2.2.3
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-2022-45442, 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 3.0.4), 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-494: Download of Code Without Integrity Check, where the product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code. 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-2022-45442 Affected Sinatra Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sinatra
|
RubyGems |
≥ 3.0
< 3.0.4
|
3.0.4
|
|
sinatra
|
RubyGems |
≥ 2.0.0
< 2.2.3
|
2.2.3
|
References
Frequently Asked Questions
What is CVE-2022-45442?
Which Sinatra versions are affected?
What version fixes CVE-2022-45442?
Is sinatra affected?
What is the CVSS score of CVE-2022-45442?
What CWE is associated with CVE-2022-45442?
How can I check RubyGems dependencies for CVE-2022-45442?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2x8x-jmrp-phxw",
"modified" : "2025-11-04T19:37:28Z",
"published" : "2022-11-30T21:18:34Z",
"aliases" : [ "CVE-2022-45442" ],
"summary" : "Sinatra vulnerable to Reflected File Download attack",
"details" : "### Description\nAn 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.\n\n### References\n* https://www.blackhat.com/docs/eu-14/materials/eu-14-Hafif-Reflected-File-Download-A-New-Web-Attack-Vector.pdf\n* https://github.com/advisories/GHSA-8x94-hmjh-97hq",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "sinatra"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0"
}, {
"fixed" : "3.0.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "sinatra"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.2.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sinatra/sinatra/security/advisories/GHSA-2x8x-jmrp-phxw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-45442"
}, {
"type" : "WEB",
"url" : "https://github.com/sinatra/sinatra/commit/ea8fc9495a350f7551b39e3025bfcd06f49f363b"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-8x94-hmjh-97hq"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sinatra/CVE-2022-45442.yml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sinatra/sinatra"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/01/msg00005.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2024/09/msg00020.html"
}, {
"type" : "WEB",
"url" : "https://www.blackhat.com/docs/eu-14/materials/eu-14-Hafif-Reflected-File-Download-A-New-Web-Attack-Vector.pdf"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-494" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-11-30T21:18:34Z",
"nvd_published_at" : "2022-11-28T21:15:00Z"
}
}