Skip to content

Open redirect in Slashify

Moderate severity GitHub Reviewed Published Feb 5, 2021 to the GitHub Advisory Database • Updated Feb 1, 2023

Package

npm slashify (npm)

Affected versions

<= 1.0.0

Patched versions

None

Description

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.

References

Reviewed Feb 5, 2021
Published to the GitHub Advisory Database Feb 5, 2021
Published by the National Vulnerability Database Feb 19, 2021
Last updated Feb 1, 2023

Severity

Moderate
6.1
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Weaknesses

CVE ID

CVE-2021-3189

GHSA ID

GHSA-f4hq-453j-p95f

Source code

No known source code
Checking history
See something to contribute? Suggest improvements for this vulnerability.