-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
security: non-breaking: Add option "allowInsecureRedirect" #30
security: non-breaking: Add option "allowInsecureRedirect" #30
Conversation
tests/test-redirect.js
Outdated
@@ -454,6 +455,18 @@ tape('http to https redirect', function (t) { | |||
}) | |||
}) | |||
|
|||
tape('http to https redirect should fail without the explicit "allowInsecureRedirect" option', function (t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to check for the inverse (https to http) as well if anyone feels up for adding it.
796f02d
to
6d4e013
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 📦
- Addresses CVE-2023-28155 - Existing behavior allows malicios redirects between protocols - Set default behavior to disable this vector (breaking) - Add new option `allowInsecureRedirect` where `true` reverts to old behavior - Ported from request#3444
6d4e013
to
3323308
Compare
note that to properly resolve GHSA-p8p7-x288-28g6 this behaviour needs to be enabled by default - given the usecase of this library and that it's a security issue I think it would be fair to argue this is a bug and so valid to change in a patch version with it enabled by default (i.e. #28) |
Closing in favor of #28 |
PR Checklist:
npm test
locally and all tests are passing.PR Description
allowInsecureRedirect
wherefalse
disables this behaviorThis is intended as a non-breaking alternative to #28. The only functional difference is that this version retains the default behavior and
allowInsecureRedirect
needs to be set explicitly to disable cross-protocol redirects.