CVE-2021-23387
MEDIUM 6.1CVSS 3.1Open Redirect in trailing-slash
The package trailing-slash before 2.0.1 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.
- Published
- 24 May 2021
- Last modified
- 8 Jul 2026
- Assigned by
- report@snyk.io
- NVD status
- Modified
- Weakness
- CWE-601
- Also known as
- GHSA-rfhr-62xp-2fp2SNYK-JS-TRAILINGSLASH-1085707
- Sources
- NVDJSONOSV GHSA-rfhr-62xp-2fp2JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | report@snyk.io (Secondary) | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 5.8 | AV:N/AC:M/Au:N/C:P/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | trailing-slash_project | trailing-slashcpe:2.3:a:trailing-slash_project:trailing-slash:*:*:*:*:*:node.js:*:* |
< 2.0.1 | 2.0.1 |
| OSV | npm | trailing-slash | < 2.0.1 | 2.0.1 |
References
- https://github.com/fardog/trailing-slash/blob/f640ece055fe85275c983de5eb94661b95e35670/index.js%23L36 · Broken Link, WEB
- https://github.com/fardog/trailing-slash/commit/f8e66f1429308247e5a119d430203077d8f05048 · Patch, Third Party Advisory, WEB
- https://snyk.io/vuln/SNYK-JS-TRAILINGSLASH-1085707 · Exploit, Patch, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-23387 · ADVISORY
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 24 May 2021)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 8 Jun 2021)