# GHSA-7P7C-PVVX-2VX3: hyper-staticfile's improper validation of Windows paths could lead to directory traversal attack

- Database: GitHub
- Severity: medium (stated by ghsa, no CVSS score)
- Published: 2022-12-05
- Modified: 2023-11-08

## Also published as

- [RUSTSEC-2022-0069](https://cve.now/RUSTSEC-2022-0069.md) (RustSec)

## Affected versions

- hyper-staticfile (crates.io): fixed in 0.9.2
- hyper-staticfile (crates.io): from 0.10.0-alpha.1, fixed in 0.10.0-alpha.2

## Description

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.

This only impacts Windows. Linux and other unix likes are not impacted by this.

## References

- https://github.com/stephank/hyper-staticfile/issues/35
- https://github.com/stephank/hyper-staticfile/pull/36
- https://github.com/stephank/hyper-staticfile/commit/1e40e31d64bc6b32e595d24074092dcf84410b2b
- https://github.com/stephank/hyper-staticfile
- https://rustsec.org/advisories/RUSTSEC-2022-0069.html

Page: https://cve.now/GHSA-7P7C-PVVX-2VX3

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
