7.5high
Local File Inclusion in Rack::Static
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.17% (higher than 68% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-7wqh-767x-r66v
Description
Rack provides an interface for developing web applications in Ruby. Prior to versions 2.2.13, 3.0.14, and 3.1.12, `Rack::Static` can serve files under the specified `root:` even if `urls:` are provided, which may expose other files under the specified `root:` unexpectedly. The vulnerability occurs because `Rack::Static` does not properly sanitize user-supplied paths before serving files. Specifically, encoded path traversal sequences are not correctly validated, allowing attackers to access files outside the designated static file directory. By exploiting this vulnerability, an attacker can gain access to all files under the specified `root:` directory, provided they are able to determine then path of the file. Versions 2.2.13, 3.0.14, and 3.1.12 contain a patch for the issue. Other mitigations include removing usage of `Rack::Static`, or ensuring that `root:` points at a directory path which only contains files which should be accessed publicly. It is likely that a CDN or similar static file server would also mitigate the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rack rack | < 2.2.13, >= 3.0, < 3.0.14, >= 3.1, < 3.1.12, before 2.2.13, from 3.0.0 before 3.0.14, from 3.1.0 before 3.1.12 | CVE List, NVD |
| rack (RubyGems) | before 2.2.13, from 3.0 before 3.0.14, from 3.1 before 3.1.12 | GitHub Advisory Database |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
Rack provides an interface for developing web applications in Ruby. Prior to versions 2.2.13, 3.0.14, and 3.1.12, `Rack::Static` can serve files under the specified `root:` even if `urls:` are provided, which may expose other files under the specified `root:` unexpectedly. The vulnerability occurs because `Rack::Static` does not properly sanitize user-supplied paths before serving files. Specifically, encoded path traversal sequences are not correctly validated, allowing attackers to access files outside the designated static file directory. By exploiting this vulnerability, an attacker can gain access to all files under the specified `root:` directory, provided they are able to determine then path of the file. Versions 2.2.13, 3.0.14, and 3.1.12 contain a patch for the issue. Other mitigations include removing usage of `Rack::Static`, or ensuring that `root:` points at a directory path which only contains files which should be accessed publicly. It is likely that a CDN or similar static file server would also mitigate the issue.
GitHub Advisory Database
Summary
Rack::Static can serve files under the specified root: even if urls: are provided, which may expose other files under the specified root: unexpectedly.
Details
The vulnerability occurs because Rack::Static does not properly sanitize user-supplied paths before serving files. Specifically, encoded path traversal sequences are not correctly validated, allowing attackers to access files outside the designated static file directory.
Impact
By exploiting this vulnerability, an attacker can gain access to all files under the specified root: directory, provided they are able to determine then path of the file.
Mitigation
- Update to the latest version of Rack, or
- Remove usage of
Rack::Static, or - Ensure that
root:points at a directory path which only contains files which should be accessed publicly.
It is likely that a CDN or similar static file server would also mitigate the issue.
NVD (es)
Rack proporciona una interfaz para desarrollar aplicaciones web en Ruby. Antes de las versiones 2.2.13, 3.0.14 y 3.1.12, `Rack::Static` puede servir archivos bajo el `root:` especificado incluso si se proporcionan `urls:`, lo que puede exponer otros archivos bajo el `root:` especificado de forma inesperada. La vulnerabilidad se produce porque `Rack::Static` no depura correctamente las rutas proporcionadas por el usuario antes de servir los archivos. En concreto, las secuencias de path traversal codificadas no se validan correctamente, lo que permite a los atacantes acceder a archivos fuera del directorio de archivos estáticos designado. Al explotar esta vulnerabilidad, un atacante puede obtener acceso a todos los archivos bajo el directorio `root:` especificado, siempre que pueda determinar la ruta del archivo. Las versiones 2.2.13, 3.0.14 y 3.1.12 contienen un parche para el problema. Otras medidas de mitigación incluyen eliminar el uso de `Rack::Static` o garantizar que `root:` apunte a una ruta de directorio que solo contenga archivos a los que se debe acceder de forma pública. Es probable que una CDN o un servidor de archivos estáticos similar también mitigue el problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-27610 changed 2025-11-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-7wqh-767x-r66v changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2025-27610 changed 2026-06-17 | Public domain |