# GHSA-wwh2-r387-g5rm: tower-http's improper validation of Windows paths could lead to directory traversal attack

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2022-06-17T00:26:05.000Z
- Modified: 2023-06-13T22:06:25.000Z
- Weaknesses: CWE-22

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

(As written by GitHub Advisory Database.)

## Affected

- tower-http (crates.io): from 0.2.0 before 0.2.1; before 0.1.3

## References

- <https://github.com/tower-rs/tower-http/pull/204> (web)
- <https://github.com/tower-rs/tower-http> (package)
- <https://rustsec.org/advisories/RUSTSEC-2021-0135.html> (web)

## Sources

- GitHub Advisory Database: [GHSA-wwh2-r387-g5rm](https://github.com/advisories/GHSA-wwh2-r387-g5rm), CC-BY-4.0, modified 2023-06-13

---

Page: https://cve.day/GHSA-wwh2-r387-g5rm · Whole record: https://cve.day/GHSA-wwh2-r387-g5rm.json · Rebuilt by cve.day 2026-11-25T22:56:42.862Z
