-
Notifications
You must be signed in to change notification settings - Fork 38
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
Ability to restrict redirection by domain #311
Comments
@seanlinsley This is security-related, right? Can you unpack more of the motivation behind this feature? And what would we do in the case where a redirect is not allowed? |
This is specifically useful for code that relies on arbitrary client-provided redirects. If an attacker can get you to visit their site by hijacking that redirect, they can do all sorts of things. Going back to the original ticket: gratipay/gratipay.com#30 (comment) is a concern. As for what to do when you run across an invalid redirect, I don't know, throw a 500? |
Hmm, rereading that I guess that's not the case. I'm not a professional security researcher, so I'm really not the one to ask IRT possible attack vectors. At the very least, it could enable phishing. |
It can also enable... redirects. Like, you know, if you want to write a bit.ly clone with aspen. Also, the suggested code could easily be:
Which allows for much more flexible handling of the offsite-redirect case. This is, IMO, not a problem that the framework can solve any better than the application can. |
If you make security hard, everyone is going to have insecure applications. |
If you want security, stop using user input for a redirect location! |
AFAICT client-provided redirects are required for OAuth, at the very least |
I guess. PRs accepted. |
Actually, after spending more time with gratipay/gratipay.com#2138, I think what's wanted here is to set |
During gratipay/gratipay.com#2138 I thought the ability to restrict the domain(s) allowed during redirection might be a nice feature to have in Aspen. For example:
The text was updated successfully, but these errors were encountered: