GHSA-wwh2-r387-g5rm: Tower http Path Traversal Vulnerability
MODERATEGHSA-wwh2-r387-g5rm is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Tower http libraries in the crates.io ecosystem. The issue involves tower-http's improper validation of windows paths could lead to directory traversal attack. Remediation is available by upgrading affected packages to version 0.2.1, 0.1.3.
GHSA-wwh2-r387-g5rm at a Glance
How to Fix GHSA-wwh2-r387-g5rm
To remediate this vulnerability, upgrade all affected Tower http dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade tower-http to 0.2.1
Upgrade tower-http to 0.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for tower-http
How to Check if You Are Affected
To determine whether your application is affected by GHSA-wwh2-r387-g5rm, inspect your project dependencies for Tower http:
inspect dependencies for tower-http
Analyze the terminal output to locate any version of Tower http in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.1), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Tower http, 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
GHSA-wwh2-r387-g5rm Affected Tower http Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tower-http
|
crates.io |
≥ 0.2.0
< 0.2.1
|
0.2.1
|
|
tower-http
|
crates.io |
< 0.1.3
|
0.1.3
|
References
Frequently Asked Questions
What is GHSA-wwh2-r387-g5rm?
Which Tower http versions are affected?
What version fixes GHSA-wwh2-r387-g5rm?
Is tower-http affected?
What CWE is associated with GHSA-wwh2-r387-g5rm?
How can I check crates.io dependencies for GHSA-wwh2-r387-g5rm?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wwh2-r387-g5rm",
"modified" : "2023-06-13T22:06:25Z",
"published" : "2022-06-17T00:26:05Z",
"aliases" : [ ],
"summary" : "tower-http's improper validation of Windows paths could lead to directory traversal attack",
"details" : "`tower_http::services::fs::ServeDir` didn't correctly validate Windows paths meaning paths like `/foo/bar/c:/windows/web/screen/img101.png` would be allowed and respond with the contents of `c:/windows/web/screen/img101.png`. Thus users could potentially read files anywhere on the filesystem. This only impacts Windows. Linux and other unix likes are not impacted by this.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "tower-http"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.2.0"
}, {
"fixed" : "0.2.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "tower-http"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.1.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tower-rs/tower-http/pull/204"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tower-rs/tower-http"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2021-0135.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T00:26:05Z",
"nvd_published_at" : null
}
}