Every CVESearch/Get API key

CVE-2026-142593

Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link.

Explain with AI
ChatGPTClaudeGoogle AI
Severity
5.3Medium
Network attack, no privileges, no user interactionCVSS 3.1, CVE List
Exploitation
Unknown
No source reports exploitation yet.
Exploit chance
0.82% in 30 days
Percentile58th
EPSS, scored
Listed fix
2.2.26 for rack
From GitHub Advisories and OSV2 more listed versions, 7 other affected packages

Overview

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.

CVSS 3.1 vector

Exploitability

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

Impact

Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Exploit chance over time

Unchanged since Dec 3, 2026
EPSS score 0.82% every day from Dec 3, 2026 to Dec 4, 2026.

Affected

Packages 8

Affected packages
PackageAffectedFixed
rack
RubyGems
2.2.0 up to 2.2.26, plus listed versions
2.2.12.2.102.2.112.2.122.2.13
Show 26 more versionsShow less
2.2.142.2.152.2.162.2.172.2.182.2.192.2.22.2.202.2.212.2.222.2.232.2.242.2.252.2.32.2.3.12.2.42.2.52.2.62.2.6.12.2.6.22.2.6.32.2.6.42.2.72.2.82.2.8.12.2.9
2.2.26
3.0.0 up to 3.1.24, plus listed versions
3.0.13.0.103.0.113.0.123.0.13
Show 41 more versionsShow less
3.0.143.0.153.0.163.0.173.0.183.0.23.0.33.0.43.0.4.13.0.4.23.0.53.0.63.0.6.13.0.73.0.83.0.93.0.9.13.1.03.1.13.1.103.1.113.1.123.1.133.1.143.1.153.1.163.1.173.1.183.1.193.1.23.1.203.1.213.1.223.1.233.1.33.1.43.1.53.1.63.1.73.1.83.1.9
3.1.24
3.2.0 up to 3.2.9, plus listed versions
3.2.13.2.23.2.33.2.43.2.53.2.63.2.73.2.8
3.2.9
gitlab-rails-18
Docker Hardened Images:Alpine:3.23
18.11.11-r0 and later, plus listed versions
18.11.11-r118.11.11-r218.11.12-r018.11.12-r118.11.12-r2
Show 24 more versionsShow less
18.11.12-r318.11.12-r418.11.14-r018.11.14-r118.11.14-r1018.11.14-r1118.11.14-r1218.11.14-r1318.11.14-r1418.11.14-r1518.11.14-r1618.11.14-r218.11.14-r318.11.14-r418.11.14-r518.11.14-r618.11.14-r718.11.14-r818.11.14-r918.11.15-r018.11.15-r118.11.15-r218.11.15-r318.11.15-r4
None listed
gitlab-rails-18
Docker Hardened Images:Alpine:3.24
18.11.11-r0 and later, plus listed versions
18.11.11-r118.11.11-r218.11.12-r018.11.12-r118.11.12-r2
Show 24 more versionsShow less
18.11.12-r318.11.12-r418.11.14-r018.11.14-r118.11.14-r1018.11.14-r1118.11.14-r1218.11.14-r1318.11.14-r1418.11.14-r1518.11.14-r1618.11.14-r218.11.14-r318.11.14-r418.11.14-r518.11.14-r618.11.14-r718.11.14-r818.11.14-r918.11.15-r018.11.15-r118.11.15-r218.11.15-r318.11.15-r4
None listed
gitlab-rails-19
Docker Hardened Images:Alpine:3.23
19.1.8-r0 and later, plus listed versions
19.1.8-r119.4.1-r019.4.1-r119.4.1-r219.4.1-r3
Show 27 more versionsShow less
19.4.2-r019.5.3-r019.5.3-r119.5.3-r219.5.3-r319.5.3-r419.5.3-r519.5.3-r619.5.3-r719.5.3-r819.5.4-r019.5.4-r119.5.5-r019.5.5-r119.5.5-r219.5.6-r019.5.6-r119.6.0-r019.6.0-r119.6.1-r019.6.1-r119.6.1-r219.6.2-r019.6.2-r119.6.2-r219.6.2-r319.6.2-r4
None listed
gitlab-rails-19
Docker Hardened Images:Alpine:3.24
19.1.8-r0 and later, plus listed versions
19.1.8-r119.4.1-r019.4.1-r119.4.1-r219.4.1-r3
Show 27 more versionsShow less
19.4.2-r019.5.3-r019.5.3-r119.5.3-r219.5.3-r319.5.3-r419.5.3-r519.5.3-r619.5.3-r719.5.3-r819.5.4-r019.5.4-r119.5.5-r019.5.5-r119.5.5-r219.5.6-r019.5.6-r119.6.0-r019.6.0-r119.6.1-r019.6.1-r119.6.1-r219.6.2-r019.6.2-r119.6.2-r219.6.2-r319.6.2-r4
None listed
gitlab-exporter
Docker Hardened Images:Debian:13
16.10.0-1 and later, plus listed versions
16.10.0-1016.10.0-1116.10.0-1216.10.0-1316.10.0-14
Show 45 more versionsShow less
16.10.0-1516.10.0-1616.10.0-1716.10.0-1816.10.0-1916.10.0-216.10.0-2016.10.0-2116.10.0-2216.10.0-2316.10.0-2416.10.0-2516.10.0-2616.10.0-2716.10.0-2816.10.0-2916.10.0-316.10.0-3016.10.0-3116.10.0-3216.10.0-3316.10.0-3416.10.0-3516.10.0-3616.10.0-3716.10.0-3816.10.0-3916.10.0-416.10.0-4016.10.0-4116.10.0-4216.10.0-4316.10.0-4416.10.0-4516.10.0-4616.10.0-4716.10.0-4816.10.0-4916.10.0-516.10.0-5016.10.0-5116.10.0-5216.10.0-616.10.0-716.10.0-8
None listed
gitlab-rails-18
Docker Hardened Images:Debian:13
18.11.11-0 and later, plus listed versions
18.11.11-118.11.11-218.11.12-018.11.12-118.11.12-2
Show 40 more versionsShow less
18.11.14-018.11.14-118.11.14-1018.11.14-1118.11.14-1218.11.14-1318.11.14-1418.11.14-1518.11.14-1618.11.14-1718.11.14-1818.11.14-1918.11.14-218.11.14-2018.11.14-2118.11.14-2218.11.14-2318.11.14-2418.11.14-2518.11.14-2618.11.14-2718.11.14-2818.11.14-2918.11.14-318.11.14-3018.11.14-3118.11.14-3218.11.14-418.11.14-518.11.14-618.11.14-718.11.14-818.11.14-918.11.15-018.11.15-118.11.15-218.11.15-318.11.15-418.11.15-518.11.15-6
None listed
gitlab-rails-19
Docker Hardened Images:Debian:13
19.1.8-0 and later, plus listed versions
19.1.8-119.4.1-019.4.1-119.4.1-219.4.2-0
Show 43 more versionsShow less
19.5.3-019.5.3-119.5.3-219.5.3-319.5.3-419.5.3-519.5.3-619.5.3-719.5.3-819.5.3-919.5.4-019.5.4-119.5.5-019.5.5-119.5.5-1019.5.5-1119.5.5-219.5.5-319.5.5-419.5.5-519.5.5-619.5.5-719.5.5-819.5.5-919.5.6-019.5.6-119.5.6-219.5.6-319.5.6-419.5.6-519.6.0-019.6.0-119.6.0-219.6.1-019.6.1-119.6.1-219.6.2-019.6.2-119.6.2-219.6.2-319.6.2-419.6.2-519.6.2-6
None listed

The JSON record also has 1 more version.

Products 1

Sources

CVE List Score usedCVSS 3.15.3

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.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.

Record
CVE-2026-142593
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Weakness
CWE-22, CWE-59
Updated
2026-12-03
EUVDEUVD-2026-141928CVSS 3.15.3

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.

Record
EUVD-2026-141928
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Updated
2026-12-02
GitHub AdvisoriesGHSA-mhj6-xc86-54m8CVSS 3.15.3

Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link

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:

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 readable through this path; only directory listings leak.

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.

All supported versions since 2.2.0 are affected. Earlier versions rejected every path containing ...

Impact

Applications 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.

Mitigation

  • 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.
  • Avoid symbolic links to directories under a root served by Rack::Directory, or avoid exposing Rack::Directory to untrusted clients.
  • At a reverse proxy, reject request paths containing .. or %2E%2E segments.
Record
GHSA-mhj6-xc86-54m8
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Weakness
CWE-22, CWE-59
Updated
2026-12-03
NVDCVSS 3.15.3

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.

Record
CVE-2026-142593
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Weakness
CWE-22, CWE-59
Updated
2026-12-03
OSVCVSS 3.15.3

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.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.

Record
CVE-2026-142593
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Weakness
CWE-22, CWE-59
Updated
2026-12-03
OSVDHI-rql4-2g5w-cbpt-dmabCVSS 3.15.3

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…

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.

Record
DHI-rql4-2g5w-cbpt-dmab
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Updated
2026-12-04
OSVGHSA-mhj6-xc86-54m8CVSS 3.15.3

Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link

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:

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 readable through this path; only directory listings leak.

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.

All supported versions since 2.2.0 are affected. Earlier versions rejected every path containing ...

Impact

Applications 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.

Mitigation

  • 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.
  • Avoid symbolic links to directories under a root served by Rack::Directory, or avoid exposing Rack::Directory to untrusted clients.
  • At a reverse proxy, reject request paths containing .. or %2E%2E segments.
Record
GHSA-mhj6-xc86-54m8
CVSS 3.1
5.3 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Weakness
CWE-22, CWE-59
Updated
2026-12-04

History

Recorded by Every CVE

Changes recorded by Every CVE
DayChangedSources
Affected packages, referencesOSV
Affected packages, other IDs, referencesOSV
Affected packages, referencesOSV
Affected packages, key facts, references
4 sourcesShow lessCVE List, GitHub Advisories, NVD, OSV
Other IDs, referencesOSV
Other IDs, published dateEUVD, NVD
First indexedCVE List

Upstream dates may differ.

References

Show 6 more referencesShow less
MoveEnter Open