{"id":"GHSA-5wvv-q5fv-2388","aliases":["RUSTSEC-2022-0072"],"status":"published","title":"hyper-staticfile's location header incorporates user input, allowing open redirect","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.\n\nAn 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.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-601"],"published":"2022-12-23T12:00:00Z","modified":"2023-11-08T04:15:57Z","fixes":[{"ecosystem":"crates.io","package":"hyper-staticfile","fixed_in":["0.9.4","0.10.0-alpha.5"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"hyper-staticfile","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.9.4"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"hyper-staticfile","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.10.0-alpha.1"},{"fixed":"0.10.0-alpha.5"}]}]},{"source":"osv","ecosystem":"crates.io","package":"hyper-staticfile","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.9.4"}]}]},{"source":"osv","ecosystem":"crates.io","package":"hyper-staticfile","ranges":[{"type":"SEMVER","events":[{"introduced":"0.10.0-alpha.1"},{"fixed":"0.10.0-alpha.5"}]}]},{"source":"osv","ecosystem":"crates.io","package":"hyper-staticfile","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.9.4"},{"introduced":"0.10.0-0"},{"fixed":"0.10.0-alpha.5"}]}]}],"references":[{"url":"https://github.com/stephank/hyper-staticfile/commit/4db4afb811c553bc3d54a01a9985b9e6dfc5a115","tags":["web"]},{"url":"https://github.com/stephank/hyper-staticfile/commit/f12cadc6666c6f555d29725f5bc45da2103f24ea","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2022-0072.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-5wvv-q5fv-2388"},{"url":"https://github.com/stephank/hyper-staticfile","tags":["package"]},{"url":"https://crates.io/crates/hyper-staticfile","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-5wvv-q5fv-2388","title":"hyper-staticfile's location header incorporates user input, allowing open redirect","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.\n\nAn 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.\n","status":"published","published":"2022-12-30T16:57:28Z","modified":"2023-01-07T05:05:25Z","cwes":["CWE-601"],"updated_at":"2026-11-02T14:36:01.39976Z"}],"osv":[{"id":"GHSA-5wvv-q5fv-2388","title":"hyper-staticfile's location header incorporates user input, allowing open redirect","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.\n\nAn 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.\n","status":"published","published":"2022-12-30T16:57:28Z","modified":"2023-11-08T04:15:57.217822Z","cwes":["CWE-601"],"updated_at":"2026-11-02T15:46:38.911014Z"},{"id":"RUSTSEC-2022-0072","title":"Location header incorporates user input, allowing open redirect","description":"When `hyper-staticfile` performs a redirect for a directory request (e.g. a\nrequest for `/dir` that redirects to `/dir/`), the `Location` header value was\nderived from user input (the request path), simply appending a slash. The\nintent was to perform an origin-relative redirect, but specific inputs\nallowed performing a scheme-relative redirect instead.\n\nAn attacker could craft a special URL that would appear to be for the correct\ndomain, but immediately redirects to a malicious domain. Such a URL can benefit\nphishing attacks, for example an innocent looking link in an email.","status":"published","published":"2022-12-23T12:00:00Z","modified":"2023-11-08T04:15:57.217822Z","updated_at":"2026-11-02T15:53:39.971022Z"}]}}
