# GHSA-5wvv-q5fv-2388: hyper-staticfile's location header incorporates user input, allowing open redirect

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2022-12-23T12:00:00.000Z
- Modified: 2023-11-08T04:15:57.217Z
- Also known as: RUSTSEC-2022-0072
- Weaknesses: CWE-601

## Description

When `hyper-staticfile` performs a redirect for a directory request (e.g. a request for `/dir` that redirects to `/dir/`), the `Location` header value was derived from user input (the request path), simply appending a slash. The intent was to perform an origin-relative redirect, but specific inputs allowed performing a scheme-relative redirect instead.

An attacker could craft a special URL that would appear to be for the correct domain, but immediately redirects to a malicious domain. Such a URL can benefit phishing attacks, for example an innocent looking link in an email.

(As written by GitHub Advisory Database.)

## Affected

- hyper-staticfile (crates.io): before 0.9.4; from 0.10.0-alpha.1 before 0.10.0-alpha.5; from 0.0.0-0 before 0.9.4; from 0.10.0-0 before 0.10.0-alpha.5

## References

- <https://github.com/stephank/hyper-staticfile/commit/4db4afb811c553bc3d54a01a9985b9e6dfc5a115> (web)
- <https://github.com/stephank/hyper-staticfile/commit/f12cadc6666c6f555d29725f5bc45da2103f24ea> (web)
- <https://github.com/stephank/hyper-staticfile> (package)
- <https://rustsec.org/advisories/RUSTSEC-2022-0072.html> (advisory, web)
- <https://crates.io/crates/hyper-staticfile> (package)

## Sources

- GitHub Advisory Database: [GHSA-5wvv-q5fv-2388](https://github.com/advisories/GHSA-5wvv-q5fv-2388), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2022-0072](https://rustsec.org/advisories/RUSTSEC-2022-0072.html), CC0-1.0, modified 2023-11-08

---

Page: https://cve.day/GHSA-5wvv-q5fv-2388 · Whole record: https://cve.day/GHSA-5wvv-q5fv-2388.json · Rebuilt by cve.day 2026-11-25T22:56:43.116Z
