Open Redirect Affecting trailing-slash package, versions <2.0.1
Snyk CVSS
Attack Complexity
Low
User Interaction
Required
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.11% (43rd
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-JS-TRAILINGSLASH-1085707
- published 17 May 2021
- disclosed 15 Mar 2021
- credit apple502j
Introduced: 15 Mar 2021
CVE-2021-23387 Open this link in a new tabHow to fix?
Upgrade trailing-slash
to version 2.0.1 or higher.
Overview
trailing-slash is an Add or remove trailing slashes, and redirect.
Affected versions of this package are vulnerable to Open Redirect via the use of trailing double slashes in the URL when accessing the vulnerable endpoint (such as https://example.com//attacker.example/
). The vulnerable code is in index.js::createTrailing()
, as the web server uses relative URLs instead of absolute URLs.
PoC
1. Set up an server endpoint that uses trailing-slashes
2. Append "//example.com" to the endpoint - it should redirect to example.com