GHSA-7p7c-pvvx-2vx3: Hyper staticfile Path Traversal Vulnerability
MODERATEGHSA-7p7c-pvvx-2vx3 is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Hyper staticfile libraries in the crates.io ecosystem. The issue involves hyper-staticfile's improper validation of windows paths could lead to directory traversal attack. Remediation is available by upgrading affected packages to version 0.9.2, 0.10.0-alpha.2.
GHSA-7p7c-pvvx-2vx3 at a Glance
How to Fix GHSA-7p7c-pvvx-2vx3
To remediate this vulnerability, upgrade all affected Hyper staticfile 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 hyper-staticfile to 0.9.2
Upgrade hyper-staticfile to 0.10.0-alpha.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for hyper-staticfile
How to Check if You Are Affected
To determine whether your application is affected by GHSA-7p7c-pvvx-2vx3, inspect your project dependencies for Hyper staticfile:
inspect dependencies for hyper-staticfile
Analyze the terminal output to locate any version of Hyper staticfile in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.2), 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 Hyper staticfile, 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-7p7c-pvvx-2vx3 Affected Hyper staticfile Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
hyper-staticfile
|
crates.io |
< 0.9.2
|
0.9.2
|
|
hyper-staticfile
|
crates.io |
≥ 0.10.0-alpha.1
< 0.10.0-alpha.2
All 1 versions
0.10.0-alpha.1
|
0.10.0-alpha.2
|
References
Frequently Asked Questions
What is GHSA-7p7c-pvvx-2vx3?
Which Hyper staticfile versions are affected?
What version fixes GHSA-7p7c-pvvx-2vx3?
Is hyper-staticfile affected?
What CWE is associated with GHSA-7p7c-pvvx-2vx3?
How can I check crates.io dependencies for GHSA-7p7c-pvvx-2vx3?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7p7c-pvvx-2vx3",
"modified" : "2022-12-05T22:03:46Z",
"published" : "2022-12-05T22:03:46Z",
"aliases" : [ ],
"summary" : "hyper-staticfile's improper validation of Windows paths could lead to directory traversal attack",
"details" : "Path resolution in `hyper-staticfile` 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.\n\nThis only impacts Windows. Linux and other unix likes are not impacted by this.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "hyper-staticfile"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.9.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "hyper-staticfile"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.10.0-alpha.1"
}, {
"fixed" : "0.10.0-alpha.2"
} ]
} ],
"versions" : [ "0.10.0-alpha.1" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/stephank/hyper-staticfile/issues/35"
}, {
"type" : "WEB",
"url" : "https://github.com/stephank/hyper-staticfile/pull/36"
}, {
"type" : "WEB",
"url" : "https://github.com/stephank/hyper-staticfile/commit/1e40e31d64bc6b32e595d24074092dcf84410b2b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/stephank/hyper-staticfile"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2022-0069.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-05T22:03:46Z",
"nvd_published_at" : null
}
}