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

Question: Why keep the password and password confirmation on the Authorization model? #21

Open
joeellis opened this issue Mar 7, 2016 · 3 comments

Comments

@joeellis
Copy link

joeellis commented Mar 7, 2016

I was just going through the code and had a question about this line:

password: password_from_auth(auth),

Could you explain why it's beneficial to set the password and password_confirmation on the Authorization model at all? AFAICT from the code, it seems like the generated token would be enough for authorization purposes, and this just leaves the password hanging around in memory, which could potentially make it vulnerable to buffer overflow attacks.

You've clearly added it here for a specific purpose though so I'm assuming I'm missing something - I just can't seem to find a reference to these fields being used on an authorization struct anywhere.

Thanks!

@joeellis
Copy link
Author

joeellis commented Mar 7, 2016

Or, second thought: is it added to allow the password / password_confirmation form fields to be re-populated on signup / signin forms in case of an error?

@joeellis joeellis changed the title Question: why Question: Why keep the password and password confirmation on the Authorization model? Mar 8, 2016
@hassox
Copy link
Owner

hassox commented May 31, 2016

I think this is just old code that I missed. It used to be that the authorization model converted the PW to the encrypted version but I moved it over.

@mikeni
Copy link

mikeni commented Aug 13, 2016

i'm wondering what you guys think about storing the encrypted password in the token field. In my past projects the password was on user table and the authorizations table was strictly oauth.

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

No branches or pull requests

3 participants