The package koa-remove-trailing-slashes before 2.0.2 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::removeTrailingSlashes()
, as the web server uses relative URLs instead of absolute URLs.
github.com/vgno/koa-remove-trailing-slashes
github.com/vgno/koa-remove-trailing-slashes/blame/6a01ba8fd019bd3ece44879c553037ad96ba7d47/index.js#L31
github.com/vgno/koa-remove-trailing-slashes/commit/e7ce4000e9fe4d957332df1056640a22ebea28ee
nvd.nist.gov/vuln/detail/CVE-2021-23384
snyk.io/vuln/SNYK-JS-KOAREMOVETRAILINGSLASHES-1085708