{"id":"CVE-2026-142593","aliases":["DHI-rql4-2g5w-cbpt-dmab","EUVD-2026-141928","GHSA-mhj6-xc86-54m8"],"status":"published","title":"Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link.","description":"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.expand_path but then passes the original unnormalized path to File.stat and Dir.foreach instead of first applying Utils.clean_path_info. 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.","severity":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-12-04","score":0.00818,"percentile":0.58493,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-22","CWE-59"],"published":"2026-12-02T21:39:42Z","modified":"2026-12-04T20:46:04Z","fixes":[{"ecosystem":"RubyGems","package":"rack","fixed_in":["2.2.26","3.1.24","3.2.9"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.2.0"},{"fixed":"2.2.26"}]}]},{"source":"ghsa","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.1.24"}]}]},{"source":"ghsa","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.2.0"},{"fixed":"3.2.9"}]}]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"gitlab-rails-18","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"18.11.11-r0"}]}],"versions":["18.11.11-r0","18.11.11-r1","18.11.11-r2","18.11.12-r0","18.11.12-r1","18.11.12-r2","18.11.12-r3","18.11.12-r4","18.11.14-r0","18.11.14-r1","18.11.14-r10","18.11.14-r11","18.11.14-r12","18.11.14-r13","18.11.14-r14","18.11.14-r15","18.11.14-r16","18.11.14-r2","18.11.14-r3","18.11.14-r4","18.11.14-r5","18.11.14-r6","18.11.14-r7","18.11.14-r8","18.11.14-r9","18.11.15-r0","18.11.15-r1","18.11.15-r2","18.11.15-r3","18.11.15-r4"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"gitlab-rails-18","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"18.11.11-r0"}]}],"versions":["18.11.11-r0","18.11.11-r1","18.11.11-r2","18.11.12-r0","18.11.12-r1","18.11.12-r2","18.11.12-r3","18.11.12-r4","18.11.14-r0","18.11.14-r1","18.11.14-r10","18.11.14-r11","18.11.14-r12","18.11.14-r13","18.11.14-r14","18.11.14-r15","18.11.14-r16","18.11.14-r2","18.11.14-r3","18.11.14-r4","18.11.14-r5","18.11.14-r6","18.11.14-r7","18.11.14-r8","18.11.14-r9","18.11.15-r0","18.11.15-r1","18.11.15-r2","18.11.15-r3","18.11.15-r4"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"gitlab-rails-19","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"19.1.8-r0"}]}],"versions":["19.1.8-r0","19.1.8-r1","19.4.1-r0","19.4.1-r1","19.4.1-r2","19.4.1-r3","19.4.2-r0","19.5.3-r0","19.5.3-r1","19.5.3-r2","19.5.3-r3","19.5.3-r4","19.5.3-r5","19.5.3-r6","19.5.3-r7","19.5.3-r8","19.5.4-r0","19.5.4-r1","19.5.5-r0","19.5.5-r1","19.5.5-r2","19.5.6-r0","19.5.6-r1","19.6.0-r0","19.6.0-r1","19.6.1-r0","19.6.1-r1","19.6.1-r2","19.6.2-r0","19.6.2-r1","19.6.2-r2","19.6.2-r3","19.6.2-r4"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"gitlab-rails-19","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"19.1.8-r0"}]}],"versions":["19.1.8-r0","19.1.8-r1","19.4.1-r0","19.4.1-r1","19.4.1-r2","19.4.1-r3","19.4.2-r0","19.5.3-r0","19.5.3-r1","19.5.3-r2","19.5.3-r3","19.5.3-r4","19.5.3-r5","19.5.3-r6","19.5.3-r7","19.5.3-r8","19.5.4-r0","19.5.4-r1","19.5.5-r0","19.5.5-r1","19.5.5-r2","19.5.6-r0","19.5.6-r1","19.6.0-r0","19.6.0-r1","19.6.1-r0","19.6.1-r1","19.6.1-r2","19.6.2-r0","19.6.2-r1","19.6.2-r2","19.6.2-r3","19.6.2-r4"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"gitlab-exporter","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"16.10.0-1"}]}],"versions":["16.10.0-1","16.10.0-10","16.10.0-11","16.10.0-12","16.10.0-13","16.10.0-14","16.10.0-15","16.10.0-16","16.10.0-17","16.10.0-18","16.10.0-19","16.10.0-2","16.10.0-20","16.10.0-21","16.10.0-22","16.10.0-23","16.10.0-24","16.10.0-25","16.10.0-26","16.10.0-27","16.10.0-28","16.10.0-29","16.10.0-3","16.10.0-30","16.10.0-31","16.10.0-32","16.10.0-33","16.10.0-34","16.10.0-35","16.10.0-36","16.10.0-37","16.10.0-38","16.10.0-39","16.10.0-4","16.10.0-40","16.10.0-41","16.10.0-42","16.10.0-43","16.10.0-44","16.10.0-45","16.10.0-46","16.10.0-47","16.10.0-48","16.10.0-49","16.10.0-5","16.10.0-50","16.10.0-51","16.10.0-52","16.10.0-6","16.10.0-7","16.10.0-8","16.10.0-9"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"gitlab-rails-18","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"18.11.11-0"}]}],"versions":["18.11.11-0","18.11.11-1","18.11.11-2","18.11.12-0","18.11.12-1","18.11.12-2","18.11.14-0","18.11.14-1","18.11.14-10","18.11.14-11","18.11.14-12","18.11.14-13","18.11.14-14","18.11.14-15","18.11.14-16","18.11.14-17","18.11.14-18","18.11.14-19","18.11.14-2","18.11.14-20","18.11.14-21","18.11.14-22","18.11.14-23","18.11.14-24","18.11.14-25","18.11.14-26","18.11.14-27","18.11.14-28","18.11.14-29","18.11.14-3","18.11.14-30","18.11.14-31","18.11.14-32","18.11.14-4","18.11.14-5","18.11.14-6","18.11.14-7","18.11.14-8","18.11.14-9","18.11.15-0","18.11.15-1","18.11.15-2","18.11.15-3","18.11.15-4","18.11.15-5","18.11.15-6"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"gitlab-rails-19","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"19.1.8-0"}]}],"versions":["19.1.8-0","19.1.8-1","19.4.1-0","19.4.1-1","19.4.1-2","19.4.2-0","19.5.3-0","19.5.3-1","19.5.3-2","19.5.3-3","19.5.3-4","19.5.3-5","19.5.3-6","19.5.3-7","19.5.3-8","19.5.3-9","19.5.4-0","19.5.4-1","19.5.5-0","19.5.5-1","19.5.5-10","19.5.5-11","19.5.5-2","19.5.5-3","19.5.5-4","19.5.5-5","19.5.5-6","19.5.5-7","19.5.5-8","19.5.5-9","19.5.6-0","19.5.6-1","19.5.6-2","19.5.6-3","19.5.6-4","19.5.6-5","19.6.0-0","19.6.0-1","19.6.0-2","19.6.1-0","19.6.1-1","19.6.1-2","19.6.2-0","19.6.2-1","19.6.2-2","19.6.2-3","19.6.2-4","19.6.2-5","19.6.2-6"]},{"source":"osv","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.2.0"},{"fixed":"2.2.26"}]}],"versions":["2.2.0","2.2.1","2.2.10","2.2.11","2.2.12","2.2.13","2.2.14","2.2.15","2.2.16","2.2.17","2.2.18","2.2.19","2.2.2","2.2.20","2.2.21","2.2.22","2.2.23","2.2.24","2.2.25","2.2.3","2.2.3.1","2.2.4","2.2.5","2.2.6","2.2.6.1","2.2.6.2","2.2.6.3","2.2.6.4","2.2.7","2.2.8","2.2.8.1","2.2.9"]},{"source":"osv","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.1.24"}]}],"versions":["3.0.0","3.0.1","3.0.10","3.0.11","3.0.12","3.0.13","3.0.14","3.0.15","3.0.16","3.0.17","3.0.18","3.0.2","3.0.3","3.0.4","3.0.4.1","3.0.4.2","3.0.5","3.0.6","3.0.6.1","3.0.7","3.0.8","3.0.9","3.0.9.1","3.1.0","3.1.1","3.1.10","3.1.11","3.1.12","3.1.13","3.1.14","3.1.15","3.1.16","3.1.17","3.1.18","3.1.19","3.1.2","3.1.20","3.1.21","3.1.22","3.1.23","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9"]},{"source":"osv","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.2.0"},{"fixed":"3.2.9"}]}],"versions":["3.2.0","3.2.1","3.2.2","3.2.3","3.2.4","3.2.5","3.2.6","3.2.7","3.2.8"]}],"products":[{"vendor":"rack","product":"rack"}],"references":[{"url":"https://github.com/rack/rack/security/advisories/GHSA-mhj6-xc86-54m8","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/rack/rack/commit/42af7a7b10c54021e060e52c91a590a5d5f2a48d","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/rack/rack/commit/c7102e91e4a1ee832b006790de31b3d5b207b89e","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/rack/rack/commit/d73bdad9e2ebec7217ecd3e9bbc079f076b0d120","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/rack/rack/releases/tag/v2.2.26","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/rack/rack/releases/tag/v3.1.24","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/rack/rack/releases/tag/v3.2.9","tags":["x_refsource_MISC","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142593","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-mhj6-xc86-54m8","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142593.json","tags":["advisory"]},{"url":"https://scout.docker.com/v/DHI-rql4-2g5w-cbpt-dmab","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-142593","tags":["advisory"]},{"url":"http://people.ubuntu.com/~ubuntu-security/cve/CVE-2026-142593","tags":["advisory"]},{"url":"https://github.com/rack/rack","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-142593","title":"Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link.","description":"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.expand_path but then passes the original unnormalized path to File.stat and Dir.foreach instead of first applying Utils.clean_path_info. 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.","status":"published","published":"2026-12-02T21:39:42.905Z","modified":"2026-12-03T18:47:11.722Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-22","CWE-59"],"ssvc":{"exploitation":"none","automatable":"yes","technical_impact":"partial","date":"2026-12-03"},"updated_at":"2026-12-03T18:54:02.926747Z"}],"euvd":[{"id":"EUVD-2026-141928","description":"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.expand_path but then passes the original unnormalized path to File.stat and Dir.foreach instead of first applying Utils.clean_path_info. 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.","status":"published","published":"2026-12-02T21:39:42Z","modified":"2026-12-03T18:47:11Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"medium"}],"updated_at":"2026-12-02T23:28:00.223966Z"}],"ghsa":[{"id":"GHSA-mhj6-xc86-54m8","title":"Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link","description":"## Summary\n\n`Rack::Directory#get` decides whether a request path containing `..` stays inside the root by expanding it lexically with `File.expand_path`, but then joins the original, unnormalized path onto the root and passes it to `File.stat` and `Dir.foreach`. The operating system resolves a symbolic link before applying a `..` that follows it, so when a directory under the root is a symlink, a request such as `/system/../` passes the check while the filesystem lists the parent of the link's target, and `/system/../config/` lists a sibling of the target. Both are outside the root. This results in disclosure of file and directory names, sizes and modification times outside the served tree.\n\n## Details\n\nThe check and the filesystem access use different paths:\n\n```ruby\ndef get(env)\n  path_info = Utils.unescape_path(env[PATH_INFO])\n  if client_error_response = check_bad_request(path_info) || check_forbidden(path_info)\n    client_error_response\n  else\n    path = ::File.join(@root, path_info)         # unnormalized\n    list_path(env, path, path_info, script_name) # File.stat, Dir.foreach\n  end\nend\n\ndef check_forbidden(path_info)\n  return unless path_info.include? \"..\"\n  expanded_path = ::File.expand_path(::File.join(@root, path_info))  # lexical\n  return if expanded_path == @root || expanded_path.start_with?(@root_with_separator)\n  # 403\nend\n```\n\nWith `public/system` linked to `shared/system`, `File.expand_path(\"public/system/../\")` is `public`, so the request is allowed, but `Dir.foreach(\"public/system/../\")` is evaluated by the kernel as `shared/system/..`, which is `shared`. The climb is bounded to one level above each symlink target, but any further symlink discovered in a listing can be used to climb again. Percent-encoded forms such as `%2E%2E` behave the same way. The `Rack::Files` application that `Rack::Directory` delegates to for files normalizes the path with `Utils.clean_path_info` before touching the filesystem, so file contents outside the root are not readable through this path; only directory listings leak.\n\n`Rack::Directory` documents that it follows symbolic links, meaning that the link's target is served. This issue goes further: the target's parent and siblings become browsable.\n\nAll supported versions since 2.2.0 are affected. Earlier versions rejected every path containing `..`.\n\n## Impact\n\nApplications that mount `Rack::Directory`, directly or through `rackup` with a directory application, with any symbolic link to a directory under the root. The Capistrano convention of linking `public/system`, `public/uploads` or `public/assets` into a release-independent `shared/` directory is the common case, and `shared/` typically also holds `config/database.yml`, `config/master.key`, logs and PID files. An unauthenticated attacker obtains the names, sizes and modification times of those entries, and can walk further through any other symlinks found. No authentication, malformed HTTP, or large payload is required. File contents are not disclosed.\n\n## Mitigation\n\n* Update to a patched version of Rack, in which `Rack::Directory` normalizes the request path with `Utils.clean_path_info` before accessing the filesystem, as `Rack::Files` already does.\n* Avoid symbolic links to directories under a root served by `Rack::Directory`, or avoid exposing `Rack::Directory` to untrusted clients.\n* At a reverse proxy, reject request paths containing `..` or `%2E%2E` segments.","status":"published","published":"2026-12-03T23:44:42Z","modified":"2026-12-03T23:44:43Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"medium"}],"cwes":["CWE-22","CWE-59"],"updated_at":"2026-12-03T23:51:45.051203Z"}],"nvd":[{"id":"CVE-2026-142593","description":"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.expand_path but then passes the original unnormalized path to File.stat and Dir.foreach instead of first applying Utils.clean_path_info. 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.","status":"published","published":"2026-12-02T22:18:36.383Z","modified":"2026-12-03T19:17:27.987Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-22","CWE-59"],"ssvc":{"exploitation":"none","automatable":"yes","technical_impact":"partial","date":"2026-12-03"},"updated_at":"2026-12-03T19:19:37.203737Z"}],"osv":[{"id":"CVE-2026-142593","title":"Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link.","description":"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.expand_path but then passes the original unnormalized path to File.stat and Dir.foreach instead of first applying Utils.clean_path_info. 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.","status":"published","published":"2026-12-02T21:39:42.905Z","modified":"2026-12-04T20:46:04.076902415Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"medium"}],"cwes":["CWE-22","CWE-59"],"updated_at":"2026-12-03T21:10:05.302032Z"},{"id":"DHI-rql4-2g5w-cbpt-dmab","upstream":["CVE-2026-142593"],"title":"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…","description":"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.expand_path but then passes the original unnormalized path to File.stat and Dir.foreach instead of first applying Utils.clean_path_info. 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.","status":"published","published":"2026-12-04T02:11:10Z","modified":"2026-12-04T13:30:20.514516481Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"medium"}],"updated_at":"2026-12-04T13:43:00.820404Z"},{"id":"GHSA-mhj6-xc86-54m8","title":"Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link","description":"## Summary\n\n`Rack::Directory#get` decides whether a request path containing `..` stays inside the root by expanding it lexically with `File.expand_path`, but then joins the original, unnormalized path onto the root and passes it to `File.stat` and `Dir.foreach`. The operating system resolves a symbolic link before applying a `..` that follows it, so when a directory under the root is a symlink, a request such as `/system/../` passes the check while the filesystem lists the parent of the link's target, and `/system/../config/` lists a sibling of the target. Both are outside the root. This results in disclosure of file and directory names, sizes and modification times outside the served tree.\n\n## Details\n\nThe check and the filesystem access use different paths:\n\n```ruby\ndef get(env)\n  path_info = Utils.unescape_path(env[PATH_INFO])\n  if client_error_response = check_bad_request(path_info) || check_forbidden(path_info)\n    client_error_response\n  else\n    path = ::File.join(@root, path_info)         # unnormalized\n    list_path(env, path, path_info, script_name) # File.stat, Dir.foreach\n  end\nend\n\ndef check_forbidden(path_info)\n  return unless path_info.include? \"..\"\n  expanded_path = ::File.expand_path(::File.join(@root, path_info))  # lexical\n  return if expanded_path == @root || expanded_path.start_with?(@root_with_separator)\n  # 403\nend\n```\n\nWith `public/system` linked to `shared/system`, `File.expand_path(\"public/system/../\")` is `public`, so the request is allowed, but `Dir.foreach(\"public/system/../\")` is evaluated by the kernel as `shared/system/..`, which is `shared`. The climb is bounded to one level above each symlink target, but any further symlink discovered in a listing can be used to climb again. Percent-encoded forms such as `%2E%2E` behave the same way. The `Rack::Files` application that `Rack::Directory` delegates to for files normalizes the path with `Utils.clean_path_info` before touching the filesystem, so file contents outside the root are not readable through this path; only directory listings leak.\n\n`Rack::Directory` documents that it follows symbolic links, meaning that the link's target is served. This issue goes further: the target's parent and siblings become browsable.\n\nAll supported versions since 2.2.0 are affected. Earlier versions rejected every path containing `..`.\n\n## Impact\n\nApplications that mount `Rack::Directory`, directly or through `rackup` with a directory application, with any symbolic link to a directory under the root. The Capistrano convention of linking `public/system`, `public/uploads` or `public/assets` into a release-independent `shared/` directory is the common case, and `shared/` typically also holds `config/database.yml`, `config/master.key`, logs and PID files. An unauthenticated attacker obtains the names, sizes and modification times of those entries, and can walk further through any other symlinks found. No authentication, malformed HTTP, or large payload is required. File contents are not disclosed.\n\n## Mitigation\n\n* Update to a patched version of Rack, in which `Rack::Directory` normalizes the request path with `Utils.clean_path_info` before accessing the filesystem, as `Rack::Files` already does.\n* Avoid symbolic links to directories under a root served by `Rack::Directory`, or avoid exposing `Rack::Directory` to untrusted clients.\n* At a reverse proxy, reject request paths containing `..` or `%2E%2E` segments.","status":"published","published":"2026-12-03T23:44:42Z","modified":"2026-12-04T00:00:04.254731371Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","level":"medium"}],"cwes":["CWE-22","CWE-59"],"updated_at":"2026-12-04T00:17:57.428011Z"}]}}
