Advisory

RUSTSEC-2022-0072

Also known as: GHSA-5wvv-q5fv-2388

Summary

Location header incorporates user input, allowing open redirect

Details

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.

Severity

Not rated by the source.

Dates

Published
2022-12-23 12:00 UTC
Modified
2023-11-08 04:15 UTC

Affected packages and fixes

hyper-staticfile

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.9.4, introduced 0.10.0-0, fixed 0.10.0-alpha.5 (semver)

Fixed versions

0.9.4, 0.10.0-alpha.5

Fix

  • Fixed version 0.9.4
    cargo update -p hyper-staticfile --precise 0.9.4
  • Fixed version 0.10.0-alpha.5
    cargo update -p hyper-staticfile --precise 0.10.0-alpha.5

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences