Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWY0aHEtNDUzai1wOTVm

Open redirect in Slashify

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.

Permalink: https://github.com/advisories/GHSA-f4hq-453j-p95f
JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWY0aHEtNDUzai1wOTVm
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: over 3 years ago
Updated: over 1 year ago


CVSS Score: 6.1
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Identifiers: GHSA-f4hq-453j-p95f, CVE-2021-3189
References: Repository: https://github.com/divshot/slashify
Blast Radius: 1.8

Affected Packages

npm:slashify
Dependent packages: 1
Dependent repositories: 2
Downloads: 47 last month
Affected Version Ranges: <= 1.0.0
No known fixed version
All affected versions: 0.1.0, 1.0.0