CVE-2021-23387: Open Redirect in trailing-slash
5.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.49235%
CWE
Published
6/8/2021
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
trailing-slash | npm | < 2.0.1 | 2.0.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
- The advisory explicitly states the vulnerability is in index.js::createTrailing().
- The commit f8e66f1 shows the fix was applied to this function by adding escapeLeadingSlashes() to sanitize the Location header.
- The pre-patch code used res.setHeader('Location', u.format(url)) with unescaped user-controlled input, enabling relative path manipulation via double slashes.
- CWE-601 mapping confirms this is a URL redirection vulnerability caused by improper URL sanitization in the Location header construction.