-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
resubmit: improved persistent cookies #26
Conversation
added methods valueExists(), setMultiValue(), deleteValues() to preferences lib added new column "created" to preferences table raised version number by one to trigger database schema update modified token generation from time to random number from now on cookies are regenerated on each login each user can have more than one persistent login token persistent login cookies will be deleted after 90 days
switched from mt_rand() to internal method OC_Util::generate_random_bytes()
Hi there, this is my first review of an Owncloud patch, so please bear with me if I'm wrong on some points. I just saw the review request on the ML and thought this is a good opportunity to give something back to Owncloud. Now on to the patch. First some general remarks:
About the new token system: I'm not sure that the proposed system is really an improvement. For example, in the old system, a stolen credential would always invalidate after 90 days. In the new system, a stolen credential stays usable, no matter what happens, as long as the thief visits the page at least once in 90 days. Even if the user changes his password. Or does Owncloud invalidate all rememberMe cookies on password change? (it should of course). Additionally, there is no way for the user to notice this, if he has two valid credentials, because the other one will not be invalidated. So if a user logs in N times, and always deletes the cookie thereafter, there will be N valid session cookies in the database, open for attack. |
This reminded me that i had a different sollution that i hadn't pushed. This is in multi_cookie_login of core. I think my solution is cleaner and doesn't need database changes specially for login cookies. |
Thanks for the review @scroogie! I'll keep it in mind. @bartv2 your approach is much better than mine, but I found some issues in it:
I found this blog entry very inspiring: Persistent Login Cookie Best Practice @bartv2 if you want I can assist you in coding. But I don't want to take it away from you ;) P.S.: In a next step maybe we should add a password dialog for accessing the users personal settings to ensure, a unauthorized person can not change the users password. P.P.S.: There is indeed a coding guideline which says: "double quotes in HTML, single quotes in JavaScript & PHP" ;) |
@visit1985 I don't mind you taking the lead with this, i'm working on other things at the moment. |
Ok, than I will do that and come back to you for a review. Please close this merge request. |
Gentlemen - this is how software development in a community should work! I'm looking forward to see more detailed reviews and constructive follow-up discussions like this |
Each user can have more than one persistent login token which enables persistent sessions in multiple browsers.
Tokens and cookies are regenerated on each login.
Tokens will be deleted if they aren't used for 90 days.
I've modified token generation from time to random number to make it more secure.
Regards,
Michael