CVE-2026-142593 — Rack — CWE-22 · CWE-59
## 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 `Di
## 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 `Di
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-142593
CVSS 5.3/10 · MEDIUM · 02.12.2026
CWE: CWE-22, CWE-59
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Path Traversal / LFI
Summary: ## 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,…
Affected: rack
⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · no user interaction (UI:N) · low attack complexity (AC:L).
🌍 REAL WORLD IMPACT
Partial confidentiality disclosure (C:L).
🛡️ REMEDIATION
→ Apply vendor security update for rack.
→ Use realpath() canonicalization, implement allowlists.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
📋 Routine update cycle (30 days)
────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]