Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-23387

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-23387
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:14 UTC · Revision 1

Source evidence

CVE-2021-23387

core-osv · Original source

Published 24 May 2021, 19:15 UTC

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.

osv:CVE-2021-23387
Complete source record
{
  "id": "fafc23e7a46b5d15be6ad8167c6ff56e52febfdd07ad20efad64382132a949da",
  "url": "https://osv.dev/vulnerability/CVE-2021-23387",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-23387",
    "summary": "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.",
    "evidence": "osv:CVE-2021-23387",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-23387",
      "aliases": [
        "CVE-2021-23387",
        "GHSA-rfhr-62xp-2fp2",
        "SNYK-JS-TRAILINGSLASH-1085707"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/fardog/trailing-slash",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "964b0c226b388ce0974d964e6da054db1766e88d"
                },
                {
                  "fixed": "f8e66f1429308247e5a119d430203077d8f05048"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:trailing-slash_project:trailing-slash:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.0.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "f8e66f1429308247e5a119d430203077d8f05048"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v2.0.0",
            "v1.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-23387.json"
          }
        }
      ],
      "modified": "2026-10-20T10:53:37.593057731Z",
      "provider": "osv",
      "references": [
        "https://github.com/fardog/trailing-slash/blob/f640ece055fe85275c983de5eb94661b95e35670/index.js%23L36",
        "https://github.com/fardog/trailing-slash/commit/f8e66f1429308247e5a119d430203077d8f05048",
        "https://snyk.io/vuln/SNYK-JS-TRAILINGSLASH-1085707"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-23387",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 384444,
  "published_at": "2021-05-24T19:15:07.427+00:00"
}