Reflected File Download in Sinatra
Sinatra before 2.2.3 in the 2.x branch and before 3.0.4 in the 3.x branch is vulnerable to a reflected file download (RFD) attack when an application derives a response Content-Disposition filename from user-supplied input. An attacker can influence the filename presented for a downloaded response.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
An attacker can conduct a reflected file download attack against a vulnerable Sinatra application and potentially cause users to download malicious files under attacker-influenced filenames.
If you can’t patch tonight, do this now.
If immediate upgrade is not possible, avoid using user-supplied data directly in Content-Disposition filenames. Restrict filenames to a server-side allowlist or generate them entirely on the server, strip or reject unsafe characters, and ensure header values are safely encoded before inclusion in responses. Where feasible, disable download behavior for endpoints that reflect untrusted input into attachment filenames.
Patch, then assume compromise.
Upgrade Sinatra to version 2.2.3 or later in the 2.x branch, or version 3.0.4 or later in the 3.x branch.
No validated public exploits yet. Hidden: 1 rejected by Mallory's analysis as not a working exploit.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
1 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.