Local File Inclusion in Rack::Static
Package
Affected versions
< 2.2.13
>= 3.0, < 3.0.14
>= 3.1, < 3.1.12
Patched versions
2.2.13
3.0.14
3.1.12
Description
Published to the GitHub Advisory Database
Mar 10, 2025
Reviewed
Mar 10, 2025
Published by the National Vulnerability Database
Mar 10, 2025
Last updated
Mar 14, 2025
Summary
Rack::Static
can serve files under the specifiedroot:
even ifurls:
are provided, which may expose other files under the specifiedroot:
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
Rack::Static
, orroot:
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.
References