Rack
CVE-2025-61780
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend request with crafted x-sendfile-type header
-
ExploitInject x-accel-mapping directive
-
ExecutionTrigger proxy internal X-Accel-Redirect
-
ImpactAccess protected internal endpoints
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V14 - Data Protection Data exposure prevention
MITRE ATT&CK
2 techniques across 2 tactics: Collection, Discovery The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitable only when ALL of the following hold: (1) the application uses Rack::Sendfile middleware behind a proxy that honors x-accel-redirect, specifically Nginx; (2) the proxy is NOT configured to always set or strip the client-supplied 'x-sendfile-type' and 'x-accel-mapping' request headers (i.e., it passes them through from the client); and (3) the application exposes at least one endpoint whose response body responds to .to_path, qualifying it for sendfile acceleration. The attack is remote and unauthenticated (PR:N) but tightly limited by this non-default header-passthrough configuration - correctly configured proxies that strip or pin these headers, applications not using Rack::Sendfile, or versions >= 2.2.20/3.1.18/3.2.3 (which ignore the request header and require explicit 'use Rack::Sendfile, "x-accel-redirect"' configuration) are not exploitable. Impact is limited to disclosure/access of protected internal routes, not arbitrary file read. |
| Impact | This is a genuine but conditional, moderate-risk issue - not a top-priority emergency. The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N, base 5.3) models a network-reachable, unauthenticated attack with only limited confidentiality impact and no integrity or availability impact, which matches the advisory's statement that it exposes protected routes but does NOT permit arbitrary file reads. However, the low-complexity rating (AC:L) understates reality: the advisory and source diff confirm exploitation requires a specific stack (Rack::Sendfile behind an x-accel-redirect-capable proxy such as Nginx), a proxy that fails to set/strip the x-sendfile-type and x-accel-mapping headers, and an app endpoint whose body responds to .to_path - so a more honest complexity is high. All corroborating-threat signals point to low urgency: EPSS is 0.55% (45th percentile), there is no CISA KEV listing, and no public exploit code is referenced in the inputs. No SSVC decision data was provided. The signals are internally consistent (low EPSS, no KEV, limited scalar impact), so this is best treated as a patch-in-normal-cycle hygiene item rather than an actively-exploited threat - prioritize it where the vulnerable Nginx/Rack::Sendfile configuration is actually present. |
| Exploit ScenarioDerived | An attacker sends an HTTP request to a Rack application sitting behind Nginx, injecting a crafted 'x-sendfile-type: x-accel-redirect' header together with a crafted 'x-accel-mapping' header, and targets a path that qualifies for proxy-based acceleration. Rack::Sendfile trusts these client-supplied headers as proxy configuration and emits an X-Accel-Redirect response, causing Nginx to reissue an internal request that bypasses its access controls and reaches administrative or otherwise protected routes. No public exploit code is identified in the provided data, and success depends on the proxy not stripping these headers. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Header-driven middleware confusion in Rack::Sendfile lets remote attackers piggyback on a proxy's x-accel-redirect handling to reach internal routes that the proxy's access controls were supposed to block. Only deployments that combine Rack::Sendfile, an Nginx-style proxy honoring x-accel-redirect, and a proxy that fails to set or strip client-supplied x-sendfile-type/x-accel-mapping headers (and that expose an endpoint whose body responds to .to_path) are affected - correctly configured proxies and versions 2.2.20, 3.1.18, and 3.2.3 are not exploitable. Exposure is limited to disclosure/access of protected routes such as admin pages, not arbitrary file read; no public exploit code or confirmed active exploitation was identified at time of analysis, and EPSS is low at 0.55% (45th percentile).
RemediationAI
Vendor-released patch: upgrade to Rack 2.2.20 for the 2.x line, 3.1.18 for 3.0/3.1, or 3.2.3 for 3.2 - the same releases also fix CVE-2025-61919 (unbounded form-parsing read), so a single upgrade addresses both. Patched code no longer honors the client's x-sendfile-type header; x-accel-redirect must be opted into explicitly with use Rack::Sendfile, "x-accel-redirect" in the middleware stack, with the trade-off that any deployment relying on header-driven configuration will silently lose sendfile acceleration until that constructor argument is added. Where upgrading is not immediately possible, fix the proxy instead: Nginx should pin or strip the headers, e.g. proxy_set_header x-sendfile-type x-accel-redirect; and proxy_set_header x-accel-mapping /var/www/=/files/; (or blank both with proxy_set_header x-sendfile-type ""; and proxy_set_header x-accel-mapping "";) - the side effect is that legitimate internal path mappings must then live in the proxy config rather than the application. Rails applications can bypass the middleware entirely with config.action_dispatch.x_sendfile_header = nil, at the cost of losing proxy-offloaded file serving and pushing static-file delivery back onto the app or a dedicated location. Fix commits are 57277b7741581fa827472c5c666f6e6a33abd784, 7e69f65eefe9cd2868df9f9f3b0977b86f93523a, and fba2c8bc63eb787ff4b19bc612d315fda6126d85.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in rubygems
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Rack is the modular Ruby web-server interface that underpins Rails and most Ruby web frameworks. Its Rack::Sendfile middleware implements the offloading pattern where the application returns a body object responding to .to_path and the front-end proxy (Nginx via X-Accel-Redirect, Apache mod_xsendfile, Lighttpd) performs the actual file delivery, avoiding a Ruby-side read. Because the middleware historically derived its 'variation' from three sources - the constructor argument, env['sendfile.type'], and the raw client header HTTP_X_SENDFILE_TYPE - an attacker could assert x-sendfile-type: x-accel-redirect and supply their own x-accel-mapping to redefine the internal-to-external path mapping. The middleware would then emit an X-Accel-Redirect response that Nginx re-issues as a fresh internal subrequest, which is evaluated outside the location-level access rules that protected the original request. The root cause class is CWE-200 (exposure of sensitive information) via trust of attacker-controlled configuration input; the upstream fix removes the client header as a variation source entirely, gates use of HTTP_X_ACCEL_MAPPING on x-accel-redirect having been explicitly enabled in the constructor AND no application-level mappings being configured, and anchors the mapping substitution regex with \A instead of ^ to prevent embedded-prefix matches. Note the scoring divergence: NVD rates this 5.3 with AC:L, while our assessment scores AC:H because the header-passthrough misconfiguration is a non-default, tightly bounded prerequisite.
Know when Rack gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Remote and unauthenticated (AV:N/PR:N), but AC:H because exploitation depends on a specific non-default proxy header-passthrough plus a .to_path endpoint; only limited route disclosure, so C:L, I:N, A:N.
Primary rating from NVD.
CVSS VectorNVD
DescriptionNVD
Rack is a modular Ruby web server interface. Prior to versions 2.2.20, 3.1.18, and 3.2.3, a possible information disclosure vulnerability existed in Rack::Sendfile when running behind a proxy that supports x-sendfile headers (such as Nginx). Specially crafted headers could cause Rack::Sendfile to miscommunicate with the proxy and trigger unintended internal requests, potentially bypassing proxy-level access restrictions. When Rack::Sendfile received untrusted x-sendfile-type or x-accel-mapping headers from a client, it would interpret them as proxy configuration directives. This could cause the middleware to send a "redirect" response to the proxy, prompting it to reissue a new internal request that was not subject to the proxy's access controls. An attacker could exploit this by setting a crafted x-sendfile-type: x-accel-redirect header, setting a crafted x-accel-mapping header, and requesting a path that qualifies for proxy-based acceleration. Attackers could bypass proxy-enforced restrictions and access internal endpoints intended to be protected (such as administrative pages). The vulnerability did not allow arbitrary file reads but could expose sensitive application routes. This issue only affected systems meeting all of the following conditions: The application used Rack::Sendfile with a proxy that supports x-accel-redirect (e.g., Nginx); the proxy did not always set or remove the x-sendfile-type and x-accel-mapping headers; and the application exposed an endpoint that returned a body responding to .to_path. Users should upgrade to Rack versions 2.2.20, 3.1.18, or 3.2.3, which require explicit configuration to enable x-accel-redirect. Alternatively, configure the proxy to always set or strip the header, or in Rails applications, disable sendfile completely.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)NVD
Directory traversal in Rack versions prior to 2.2.22, 3.1.20, and 3.2.5 allows unauthenticated remote attackers to list
Rack is a modular Ruby web server interface. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable,
Rack is a modular Ruby web server interface. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable,
A reliance on cookies without validation/integrity check security vulnerability exists in rack < 2.2.3, rack < 2.1.4 tha
A sequence injection vulnerability exists in Rack <2.0.9.1, <2.1.4.1 and <2.2.3.1 which could allow is a possible shell
Rack provides an interface for developing web applications in Ruby. Rated medium severity (CVSS 5.7), this vulnerability
Rack's Directory module fails to sanitize filenames when generating HTML directory listings, allowing attackers to craft
Session authentication bypass in Rack::Session::Cookie 2.0.0 through 2.1.1 allows unauthenticated remote attackers to fo
A directory traversal vulnerability exists in rack < 2.2.0 that allows an attacker perform directory traversal vulnerabi
Rack::Session::Cookie in Rack 1.5.x before 1.5.2, 1.4.x before 1.4.5, 1.3.x before 1.3.10, 1.2.x before 1.2.8, and 1.1.x
A DoS vulnerability exists in Rack <v3.0.4.2, <v2.2.6.3, <v2.1.4.3 and <v2.0.9.3 within in the Multipart MIME parsing co
Memory exhaustion denial of service in the Ruby Rack web server interface (versions prior to 2.2.19, 3.1.17, and 3.2.2)
NVD
CVE.org
EPSS
GitHub
Exploit-DB