Skip to content
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

Email report of 500 error at /accounts/login/ shows the entered password in plain text #1869

Closed
jogwen opened this issue Aug 8, 2018 · 5 comments
Labels

Comments

@jogwen
Copy link

jogwen commented Aug 8, 2018

Happened as a result of situation described in the separate Issue report 1868. After the full traceback, the email showed the following (note the password value entered by the user - shown in plain text):

Request repr():
<WSGIRequest
path:/accounts/login/,
GET:<QueryDict: {u'next': [u'/contact-us/']}>,
POST:<QueryDict: {u'username': [u'g.smith@example.com'], u'referrer': [u'https://example.com/contact-us/'], u'csrfmiddlewaretoken': [u'ejnpimakedhajhdlcegeplioahd'], u'password': [u'orangesAnd5Lemons']}>,

Django's version of the view that covers this is protected by the sensitive_post_parameters decorator, so that the values of POST parameters never appear in the emailed error report.

@jogwen jogwen changed the title Email report of 500 error at /accounts/login/ show the entered password in plain text Email report of 500 error at /accounts/login/ shows the entered password in plain text Aug 8, 2018
@jerivas
Copy link
Collaborator

jerivas commented Aug 8, 2018

So is it a matter of just decorating the view?

@jogwen
Copy link
Author

jogwen commented Aug 8, 2018

I think so yes, but the slightly trickier bit might be figuring out which methods to decorate and for each one whether to protect only some variables (in which case supply their names as arguments to the decorator) or all the variables (supply no arguments to decorator). Try grepping the django code for sensitive_post_parameters and sensitive_variables to see how they do it there, and then figure out which of those methods have been 'replaced' in Mezzanine.

@jerivas
Copy link
Collaborator

jerivas commented Aug 8, 2018

Looks like we just need to decorate login, signup, and profile_update on the account views. The sensitive fields are password on LoginForm and password1, password2 on ProfileForm.

Would you like to contribute a PR?

@jerivas
Copy link
Collaborator

jerivas commented Oct 1, 2018 via email

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants