GHSA-f4hq-453j-p95f

Suggest an improvement
Source
https://github.com/advisories/GHSA-f4hq-453j-p95f
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/02/GHSA-f4hq-453j-p95f/GHSA-f4hq-453j-p95f.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-f4hq-453j-p95f
Aliases
  • CVE-2021-3189
Published
2021-02-05T20:43:34Z
Modified
2023-11-08T04:05:51.576972Z
Severity
  • 6.1 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N CVSS Calculator
Summary
Open redirect in Slashify
Details

The package is an Express middleware that normalises routes by stripping any final slash, redirecting, for example, bookings/latest/ to bookings/latest. However, it does not validate the path it redirects to in any way. In particular, if the path starts with two slashes (or two backslashes, or a slash and a backslash, etc.) it may redirect to a different domain.

Consider the example from the docs. Assume we have run it and started a server on localhost:3000, then visiting localhost:3000///github.com/ redirects you to https://github.com.

Recommendation

This vulnerability is currently un-patched in the slashify package so there is no known safe version of this package. Discontinuing use of slashify is recommended.

Database specific
{
    "github_reviewed": true,
    "nvd_published_at": "2021-02-19T23:15:00Z",
    "github_reviewed_at": "2021-02-05T20:42:47Z",
    "severity": "MODERATE",
    "cwe_ids": [
        "CWE-601"
    ]
}
References

Affected packages

npm / slashify

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Last affected
1.0.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/02/GHSA-f4hq-453j-p95f/GHSA-f4hq-453j-p95f.json"