CVE-2026-22860: Rack Directory Vulnerability

HIGH
Advisory Identifier: GHSA-mxw3-3hh2-x2mh
CVSS 7.5
CWE-548 CWE-22
Published
Advisory Summary

CVE-2026-22860 is a HIGH (CVSS 7.5) directory vulnerability (CWE-548: Exposure of Information Through Directory Listing) affecting Rack libraries in the RubyGems ecosystem. The issue involves directory. Remediation is available by upgrading affected packages to version 2.2.22, 3.1.20, 3.2.5.

CVE-2026-22860 at a Glance

CVE Identifier CVE-2026-22860
GHSA Identifier GHSA-mxw3-3hh2-x2mh
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-548: Exposure of Information Through Directory Listing
Affected Product Rack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-22860

To remediate this vulnerability, upgrade all affected Rack dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rack fixed: 2.2.22
Upgrade rack to 2.2.22
rack fixed: 3.1.20
Upgrade rack to 3.1.20
rack fixed: 3.2.5
Upgrade rack to 3.2.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rack

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-22860, inspect your project dependencies for Rack:

inspect dependencies for rack

Analyze the terminal output to locate any version of Rack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.22), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-548: Exposure of Information Through Directory Listing, where the product inappropriately exposes a directory listing with an index of all the resources located inside of the directory. In Rack, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-22860 Affected Rack Versions

3 component(s)
Fixed Versions:
2.2.223.1.203.2.5
Product / Package Ecosystem Affected Versions Fixed Version
rack
RubyGems
< 2.2.22
2.2.22
rack
RubyGems
≥ 3.0.0.beta1
< 3.1.20
3.1.20
rack
RubyGems
≥ 3.2.0
< 3.2.5
3.2.5

References

Frequently Asked Questions

What is CVE-2026-22860?
CVE-2026-22860 is a security vulnerability in Rack involving Directory under CWE-548: Exposure of Information Through Directory Listing.
Which Rack versions are affected?
Affected versions include releases prior to 2.2.22, 3.1.20, 3.2.5 across affected packages: rack.
What version fixes CVE-2026-22860?
Upgrading to 2.2.22, 3.1.20, 3.2.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rack affected?
Yes, rack is affected in releases prior to 2.2.22, 3.1.20, 3.2.5. Upgrade your dependency to 2.2.22, 3.1.20, 3.2.5 or later.
What is the CVSS score of CVE-2026-22860?
CVE-2026-22860 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-22860?
CVE-2026-22860 is classified under CWE-548: Exposure of Information Through Directory Listing (The product inappropriately exposes a directory listing with an index of all the resources located inside of the directory.).
How can I check RubyGems dependencies for CVE-2026-22860?
Run the dependency tree command: 'inspect dependencies for rack'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mxw3-3hh2-x2mh",
  "modified" : "2026-02-24T16:06:28Z",
  "published" : "2026-02-17T16:14:11Z",
  "aliases" : [ "CVE-2026-22860" ],
  "summary" : "Rack has a Directory Traversal via Rack:Directory",
  "details" : "## Summary\n\n`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.\n\n## Details\n\nIn `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. \n\n## Impact\n\nInformation 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`).\n\n## Mitigation\n\n* Update to a patched version of Rack that correctly checks the root prefix.\n* Don't name directories with the same prefix as one which is exposed via `Rack::Directory`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0.beta1"
      }, {
        "fixed" : "3.1.20"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.0"
      }, {
        "fixed" : "3.2.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/security/advisories/GHSA-mxw3-3hh2-x2mh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22860"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/75c5745c286637a8f049a33790c71237762069e7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rack/rack"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2026-22860.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-548" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-17T16:14:11Z",
    "nvd_published_at" : "2026-02-18T19:21:43Z"
  }
}