HighGHSA-mxw3-3hh2-x2mhCVE-2026-22860

Rack has a Directory Traversal via Rack:Directory

Published 17 Feb 2026 · Updated 10 Sept 2026

Is your project on an affected rack?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected packages

rackRubyGems
Affected
<2.2.22
Fixed in
2.2.22
Update to the fixed version for your release line, for example:bundle update --conservative rack # Gemfile: '>= 2.2.22'
rackRubyGems
Affected
>=3.0.0.beta1 <3.1.20
Fixed in
3.1.20
Update to the fixed version for your release line, for example:bundle update --conservative rack # Gemfile: '>= 3.1.20'
rackRubyGems
Affected
>=3.2.0 <3.2.5
Fixed in
3.2.5
Update to the fixed version for your release line, for example:bundle update --conservative rack # Gemfile: '>= 3.2.5'

Details

Summary

Rack::Directory’s path check used a string prefix match on the expanded path. A request like /../root_example/ can escape the configured root if the target path starts with the root string, allowing directory listing outside the intended root.

Details

In directory.rb, File.expand_path(File.join(root, path_info)).start_with?(root) does not enforce a path boundary. If the server root is /var/www/root, a path like /var/www/root_backup passes the check because it shares the same prefix, so Rack::Directory will list that directory also.

Impact

Information disclosure via directory listing outside the configured root when Rack::Directory is exposed to untrusted clients and a directory shares the root prefix (e.g., public2, www_backup).

Mitigation

  • Update to a patched version of Rack that correctly checks the root prefix.
  • Don't name directories with the same prefix as one which is exposed via Rack::Directory.

Is GHSA-mxw3-3hh2-x2mh in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected rack, and gives you the command that fixes it.

More advisories for rack

  • HighCVE-2026-125111Rack: Multipart parsing allows DoS via unbounded scan buffer growth · 10 Nov 2026
  • LowCVE-2026-125108Rack: Multipart boundary ambiguity guard in Rack::Multipart::Parser can be bypassed with a quoted boundary value, allowing WAF bypass · 10 Nov 2026
  • MediumCVE-2026-125109Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835 · 10 Nov 2026
  • MediumCVE-2026-125110Rack: Rack::Static header_rules bypass via dot-segment normalization mismatch · 10 Nov 2026
  • MediumCVE-2026-34835Rack::Request accepts invalid Host characters, enabling host allowlist bypass · 2 Apr 2026
  • MediumCVE-2026-34831Rack has Content-Length mismatch in Rack::Files error responses · 2 Apr 2026
All 54 advisories for rack

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.