-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Allow custom scheme to be used as redirection URIs #50552
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
Conversation
ea5dfcf
to
b6ceb8e
Compare
The support for URNs could be removed. It looks like it is not part of the current best practices (see RFC8252); custom scheme like |
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.
(don't miss syncing the PR description with latest changes)
ee69421
to
0486a18
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.
See stof's review. Also keeping existing tests untouched makes the patch easier to review, which makes me much more confident to merge on security-related topics especially. Please avoid any refactoring if possible :)
7e2abc6
to
df36a1a
Compare
Hi @chalasr, Many thanks for your comment. I restored the previous tests and keep the one I created. Let me know if you agree with the modifications. Regarding the behavior of paths starting with |
df36a1a
to
9c5d1e6
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.
I removed the part about supposedly security hardening, which are unproven to me and change the behavior.
Agreed. Let's keep it simple and without any BC. |
9c5d1e6
to
3a6969f
Compare
Thank you @Spomky. |
ping @sdespont and @MatTheCat
This PR aims at fixing the redirection issue where only URLs starting with
http
are allowed.With the modified behavior, it is now allowed to use any URL scheme. It will be possible to redirect to
android-app://com.google.android.gm/
.In addition, it prevents the redirection to the following URLs:With path traversal e.g.https://example.com/foo/../../.htpasswd
With protocol-relative e.g.//malicious.app/foo/bar