CVE-2026-142593
## Summary `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. ## Details The check and the filesystem access use different paths: ```ruby def get(env) path_info = Utils.unescape_path(env[PATH_INFO]) if client_error_response = check_bad_request(path_info) || check_forbidden(path_info) client_error_response else path = ::File.join(@root, path_info) # unnormalized list_path(env, path, path_info, script_name) # File.stat, Dir.foreach end end def check_forbidden(path_info) return unless path_info.include? ".." expanded_path = ::File.expand_path(::File.join(@root, path_info)) # lexical return if expanded_path == @root || expanded_path.start_with?(@root_with_separator) # 403 end ``` With `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 rea
Properties
- Severity
- medium
- Summary
- Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link
- Nvd fetched at
- 2026-12-04T15:00:48.841578+00:00
- Epss score
- 0.00818
- Cvss severity
- MEDIUM
- Cvss score
- 5.3
- Retrieved at
- 2026-12-04T15:02:58+00:00
- Ghsa published
- 2026-12-03T23:44:42Z
- Source url
- https://github.com/advisories/GHSA-mhj6-xc86-54m8
- Ghsa updated
- 2026-12-03T23:44:43Z
- Ghsa id
- GHSA-mhj6-xc86-54m8
- Last source
- FIRST EPSS
- Score
- 5.3
- Cvss version
- 3.1
- Cve id
- CVE-2026-142593
- Cvss vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- First seen by Signal
- 2026-12-02T22:45:38+00:00
- Name
- CVE-2026-142593
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Related Entities (4)
HAS_WEAKNESS (2)
AFFECTS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph