BREW-TRAVIS-CVE-2026-142593 (GHSA-MHJ6-XC86-54M8)
Vulnerability from osv_homebrew – Published: 2026-12-04 10:11 – Updated: 2026-12-04 10:11 – Source websiteSummary
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::Directorynormalizes the request path withUtils.clean_path_infobefore accessing the filesystem, asRack::Filesalready does. - Avoid symbolic links to directories under a root served by
Rack::Directory, or avoid exposingRack::Directoryto untrusted clients. - At a reverse proxy, reject request paths containing
..or%2E%2Esegments.
{
"affected": [
{
"ecosystem_specific": {
"fix": null,
"range_state": "affected",
"resource": "rack",
"resource_purl": "pkg:gem/rack@3.0.11",
"upstream_fixed_in": "3.1.24"
},
"package": {
"ecosystem": "Homebrew",
"name": "travis",
"purl": "pkg:brew/travis"
},
"ranges": [
{
"events": [
{
"introduced": "1.14.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"database_specific": {
"confidence": "high",
"source": "matched",
"strategy": "registry",
"upstream_evidence": [
{
"ecosystem": "RubyGems",
"key": "pkg:gem/rack@3.0.11",
"name": "rack",
"resource": "rack",
"strategy": "registry",
"subject_version": "3.0.11"
}
]
},
"details": "## Summary\n\n`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\u0027s 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.\n\n## Details\n\nThe check and the filesystem access use different paths:\n\n```ruby\ndef get(env)\n path_info = Utils.unescape_path(env[PATH_INFO])\n if client_error_response = check_bad_request(path_info) || check_forbidden(path_info)\n client_error_response\n else\n path = ::File.join(@root, path_info) # unnormalized\n list_path(env, path, path_info, script_name) # File.stat, Dir.foreach\n end\nend\n\ndef check_forbidden(path_info)\n return unless path_info.include? \"..\"\n expanded_path = ::File.expand_path(::File.join(@root, path_info)) # lexical\n return if expanded_path == @root || expanded_path.start_with?(@root_with_separator)\n # 403\nend\n```\n\nWith `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.\n\n`Rack::Directory` documents that it follows symbolic links, meaning that the link\u0027s target is served. This issue goes further: the target\u0027s parent and siblings become browsable.\n\nAll supported versions since 2.2.0 are affected. Earlier versions rejected every path containing `..`.\n\n## Impact\n\nApplications 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.\n\n## Mitigation\n\n* 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.\n* Avoid symbolic links to directories under a root served by `Rack::Directory`, or avoid exposing `Rack::Directory` to untrusted clients.\n* At a reverse proxy, reject request paths containing `..` or `%2E%2E` segments.",
"id": "BREW-travis-CVE-2026-142593",
"modified": "2026-12-04T10:11:53Z",
"published": "2026-12-04T10:11:53Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/rack/rack/security/advisories/GHSA-mhj6-xc86-54m8"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-142593"
},
{
"type": "WEB",
"url": "https://github.com/rack/rack/commit/42af7a7b10c54021e060e52c91a590a5d5f2a48d"
},
{
"type": "WEB",
"url": "https://github.com/rack/rack/commit/c7102e91e4a1ee832b006790de31b3d5b207b89e"
},
{
"type": "WEB",
"url": "https://github.com/rack/rack/commit/d73bdad9e2ebec7217ecd3e9bbc079f076b0d120"
},
{
"type": "PACKAGE",
"url": "https://github.com/rack/rack"
},
{
"type": "WEB",
"url": "https://github.com/rack/rack/releases/tag/v2.2.26"
},
{
"type": "WEB",
"url": "https://github.com/rack/rack/releases/tag/v3.1.24"
},
{
"type": "WEB",
"url": "https://github.com/rack/rack/releases/tag/v3.2.9"
}
],
"schema_version": "1.7.3",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Rack: `Rack::Directory` lists directories outside the root when `..` follows a symbolic link",
"upstream": [
"GHSA-mhj6-xc86-54m8",
"CVE-2026-142593"
]
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.