CVE-2021-23387 Open Redirect

Medium 5.4 Published Updated

An attacker can redirect users to malicious sites via double slashes in URLs, affecting applications using the trailing-slash npm package.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-23387?

CVE-2021-23387 is a medium-severity vulnerability in trailing-slash, published on 24 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-601

Which versions are affected by CVE-2021-23387?

2 open source packages ship an affected version, including trailing-slash. It affects 1 product.

PackageAffectedFixed in
trailing-slash npmAll versions2.0.1
trailing-slash npmAll versions2.0.1

Products include Trailing-Slash Project Trailing-Slash.

How do I fix CVE-2021-23387?

Upgrade trailing-slash to 2.0.1 or later.

Is CVE-2021-23387 being exploited?

There is no known exploitation of CVE-2021-23387 in the wild and no public exploit code.

Sources

Also known as GHSA-rfhr-62xp-2fp2, SNYK-JS-TRAILINGSLASH-1085707.

Is CVE-2021-23387 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free