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.
{"id": "OSV:GHSA-5WVV-Q5FV-2388", "vendorId": null, "type": "osv", "bulletinFamily": "software", "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", "published": "2022-12-30T16:57:28", "modified": "2022-12-30T16:57:28", "cvss": {"score": 0.0, "vector": "NONE"}, "cvss2": {}, "cvss3": {}, "href": "https://osv.dev/vulnerability/GHSA-5wvv-q5fv-2388", "reporter": "Google", "references": ["https://github.com/stephank/hyper-staticfile/commit/4db4afb811c553bc3d54a01a9985b9e6dfc5a115", "https://github.com/stephank/hyper-staticfile/commit/f12cadc6666c6f555d29725f5bc45da2103f24ea", "https://github.com/stephank/hyper-staticfile", "https://rustsec.org/advisories/RUSTSEC-2022-0072.html"], "cvelist": [], "immutableFields": [], "lastseen": "2022-12-30T17:15:05", "viewCount": 11, "enchantments": {"score": {"value": 2.3, "vector": "NONE"}, "affected_software": {"major_version": [{"name": "hyper-staticfile", "version": 0}, {"name": "hyper-staticfile", "version": 0}, {"name": "hyper-staticfile", "version": 0}]}, "vulnersScore": 2.3}, "_state": {"score": 1672420509, "dependencies": 1672420514, "affected_software_major_version": 1672420530, "epss": 1679354432}, "_internal": {"score_hash": "b472452c8525d4a76036ba02d076d27f"}, "affectedSoftware": [{"version": "0.9.4", "operator": "lt", "name": "hyper-staticfile"}, {"version": "0.10.0-alpha.1", "operator": "ge", "name": "hyper-staticfile"}, {"version": "0.10.0-alpha.5", "operator": "lt", "name": "hyper-staticfile"}]}