CVE-2025-61780

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.
Configurations

Configuration 1 (hide)

OR cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:*
cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:*
cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:*

History

19 Oct 2026, 22:10

Type Values Removed Values Added
Summary
  • (es) Rack es una interfaz modular de servidor web Ruby. Versiones anteriores a la 2.2.20, 3.1.18 y 3.2.3, existía una posible vulnerabilidad de revelación de información en ’Rack::Sendfile’ al ejecutarse detrás de un proxy que soporta cabeceras ’x-sendfile’ (como Nginx). Cabeceras especialmente manipuladas podrían causar que ’Rack::Sendfile’ se comunicara erróneamente con el proxy y desencadenara solicitudes internas no intencionadas, eludiendo potencialmente las restricciones de acceso a nivel de proxy. Cuando ’Rack::Sendfile’ recibía cabeceras ’x-sendfile-type’ o ’x-accel-mapping’ no confiables de un cliente, las interpretaba como directivas de configuración del proxy. Esto podría causar que el middleware enviara una respuesta de ’redirect’ al proxy, lo que lo impulsaría a reemitir una nueva solicitud interna que no estaba sujeta a los controles de acceso del proxy. Un atacante podría explotar esto configurando una cabecera ’x-sendfile-type: x-accel-redirect’ manipulada, configurando una cabecera ’x-accel-mapping’ manipulada y solicitando una ruta que califique para la aceleración basada en proxy. Los atacantes podrían eludir las restricciones impuestas por el proxy y acceder a endpoints internos destinados a ser protegidos (como páginas administrativas). La vulnerabilidad no permitía lecturas arbitrarias de archivos, pero podría exponer rutas sensibles de la aplicación. Este problema solo afectaba a sistemas que cumplían todas las siguientes condiciones: La aplicación utilizaba ’Rack::Sendfile’ con un proxy que soporta ’x-accel-redirect’ (por ejemplo, Nginx); el proxy no siempre establecía o eliminaba las cabeceras ’x-sendfile-type’ y ’x-accel-mapping’; y la aplicación exponía un endpoint que devolvía un cuerpo que respondía a ’.to_path’. Los usuarios deberían actualizar a las versiones de Rack 2.2.20, 3.1.18 o 3.2.3, que requieren configuración explícita para habilitar ’x-accel-redirect’. Alternativamente, configure el proxy para que siempre establezca o elimine la cabecera, o en aplicaciones Rails, deshabilite sendfile por completo.

Information

Published : 2025-10-10 17:15

Updated : 2026-10-19 22:10


NVD link : CVE-2025-61780

Mitre link : CVE-2025-61780

CVE.ORG link : CVE-2025-61780


JSON object : View

Products Affected

rack

  • rack
CWE
CWE-200

Exposure of Sensitive Information to an Unauthorized Actor

CWE-441

Unintended Proxy or Intermediary ('Confused Deputy')

CWE-913

Improper Control of Dynamically-Managed Code Resources