-
Notifications
You must be signed in to change notification settings - Fork 345
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
Prevent leaking password reset token through Referrer header #268
Conversation
@macropin @dicato I tried to go through a list of similar apps that might have issues to alert them: https://djangopackages.org/grids/g/registration/ |
registration/auth_urls.py
Outdated
@@ -27,35 +27,54 @@ | |||
from django.core.urlresolvers import reverse_lazy | |||
from django.contrib.auth import views as auth_views | |||
|
|||
# Attempt to use the auth class based views if available. | |||
try: | |||
login_view = auth_views.LoginView.as_view() |
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.
need to pass kwargs to as_view
to override defaults
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.
done
@joshblum sorry for the delay. Looks good to me! Do you want to fix the use of "referrer" to "referer"? Probably good to be consistent with the original misspelling. |
@dicato great! fixed the misspellings and will merge/pypy bump after tests :) |
Addresses #266, preventing the leaking of password reset token through the
Referrer
header.For Django 1.11+, we fix by using the newer class based views.
For versions of Django below 1.11 we add a
meta
block to the template add at the meta tag<meta name="referrer" content="never">
. In addition, we addrel="noreferrer"
to the password reset email.