GHSA-5wvv-q5fv-2388: Hyper staticfile Hyper-staticfile's Location Header Incorporates User Vulnerability

MODERATE
CWE-601
Published
Advisory Summary

GHSA-5wvv-q5fv-2388 is a MODERATE hyper-staticfile's location header incorporates user vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Hyper staticfile libraries in the crates.io ecosystem. The issue involves hyper-staticfile's location header incorporates user input, allowing open redirect. Remediation is available by upgrading affected packages to version 0.9.4, 0.10.0-alpha.5.

GHSA-5wvv-q5fv-2388 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5wvv-q5fv-2388
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Hyper staticfile
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-5wvv-q5fv-2388

To remediate this vulnerability, upgrade all affected Hyper staticfile dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

hyper-staticfile fixed: 0.9.4
Upgrade hyper-staticfile to 0.9.4
hyper-staticfile fixed: 0.10.0-alpha.5
Upgrade hyper-staticfile to 0.10.0-alpha.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for hyper-staticfile

How to Check if You Are Affected

To determine whether your application is affected by GHSA-5wvv-q5fv-2388, inspect your project dependencies for Hyper staticfile:

inspect dependencies for hyper-staticfile

Analyze the terminal output to locate any version of Hyper staticfile in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Hyper staticfile, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

GHSA-5wvv-q5fv-2388 Affected Hyper staticfile Versions

2 component(s)
Fixed Versions:
0.9.40.10.0-alpha.5
Product / Package Ecosystem Affected Versions Fixed Version
hyper-staticfile
crates.io
< 0.9.4
0.9.4
hyper-staticfile
crates.io
≥ 0.10.0-alpha.1
< 0.10.0-alpha.5
0.10.0-alpha.5

References

Frequently Asked Questions

What is GHSA-5wvv-q5fv-2388?
GHSA-5wvv-q5fv-2388 is a security vulnerability in Hyper staticfile involving hyper-staticfile's location header incorporates user input, allowing open redirect under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Hyper staticfile versions are affected?
Affected versions include releases prior to 0.9.4, 0.10.0-alpha.5 across affected packages: hyper-staticfile.
What version fixes GHSA-5wvv-q5fv-2388?
Upgrading to 0.9.4, 0.10.0-alpha.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hyper-staticfile affected?
Yes, hyper-staticfile is affected in releases prior to 0.9.4, 0.10.0-alpha.5. Upgrade your dependency to 0.9.4, 0.10.0-alpha.5 or later.
What CWE is associated with GHSA-5wvv-q5fv-2388?
GHSA-5wvv-q5fv-2388 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check crates.io dependencies for GHSA-5wvv-q5fv-2388?
Run the dependency tree command: 'inspect dependencies for hyper-staticfile'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5wvv-q5fv-2388",
  "modified" : "2022-12-30T16:57:28Z",
  "published" : "2022-12-30T16:57:28Z",
  "aliases" : [ ],
  "summary" : "hyper-staticfile's 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.\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",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "hyper-staticfile"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.9.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "hyper-staticfile"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.10.0-alpha.1"
      }, {
        "fixed" : "0.10.0-alpha.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/stephank/hyper-staticfile/commit/4db4afb811c553bc3d54a01a9985b9e6dfc5a115"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stephank/hyper-staticfile/commit/f12cadc6666c6f555d29725f5bc45da2103f24ea"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/stephank/hyper-staticfile"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2022-0072.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-30T16:57:28Z",
    "nvd_published_at" : null
  }
}