CVE-2026-142593: Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link.
Rack is a modular Ruby web server interface. From 2.2.0 until 2.2.26, 3.1.24, and 3.2.9, Rack::Directory#get checks a path containing dot-dot segments with File.expandpath but then passes the original unnormalized path to File.stat and Dir.foreach instead of first applying Utils.cleanpathinfo. Earlier Rack versions reject every path containing dot-dot and are not affected. When a directory beneath the served root is a symbolic link followed by .., the operating system resolves the link before applying the dot-dot segment, allowing an unauthenticated request to list the target's parent or siblings outside the root. The disclosure is limited to directory entry names, sizes, and modification times because Rack::Files normalizes paths before serving file contents. This issue is fixed in versions 2.2.26, 3.1.24, and 3.2.9.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.2.26 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.1.24 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.2.9
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using Rack::Directory in Rack 2.2.0 through 2.2.25, 3.1 versions before 3.1.24, or 3.2 versions before 3.2.9 may be exposed. Exploitation additionally requires a directory under the served root that is a symbolic link.
What does an attacker need to exploit it?
An attacker can make an unauthenticated network request. They need a path that traverses through a symbolic link beneath the served root and then uses a dot-dot segment, causing the operating system to resolve outside the root.
Can this expose file contents outside the served root?
No. The disclosed information is limited to directory entry names, sizes, and modification times; Rack::Files normalizes paths before serving file contents.
What should be done if an upgrade cannot happen immediately?
Remove or avoid symbolic links within directories served by Rack::Directory, particularly where a request could follow the link with a dot-dot segment. Earlier Rack versions that reject every path containing dot-dot are not affected.
Which versions contain the fix?
Upgrade to Rack 2.2.26, 3.1.24, or 3.2.9.