GHSA-wwh2-r387-g5rm tower-http's improper validation of Windows paths could lead to directory traversal attack
An attacker can read arbitrary files on Windows systems via directory traversal in tower-http's ServeDir service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-wwh2-r387-g5rm?
GHSA-wwh2-r387-g5rm is a path traversal vulnerability in tower-http, published on 17 Jun 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.Which versions are affected by GHSA-wwh2-r387-g5rm?
4 open source packages ship an affected version, including tower-http.
| Package | Affected | Fixed in |
|---|---|---|
tower-http crates.io | All versions | 0.1.3 |
tower-http crates.io | All versions | 0.1.3 |
tower-http crates.io | From 0.2.0 | 0.2.1 |
tower-http crates.io | From 0.2.0 | 0.2.1 |
How do I fix GHSA-wwh2-r387-g5rm?
Upgrade tower-http to a fixed version for your release line: 0.1.3 or 0.2.1.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is GHSA-wwh2-r387-g5rm being exploited?
There is no known exploitation of GHSA-wwh2-r387-g5rm in the wild and no public exploit code.