-
Notifications
You must be signed in to change notification settings - Fork 675
This pull request fixes issue #1063 #1067
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
Conversation
Thank's for the PR, but wouldn't this allow anyone to generate a session cookie given prior knowledge of the username? Perhaps taking the hash of the UserModel object would provide sufficient entropy. |
Perhaps the UserModel object without its password, @paulsputer ? |
I don't think the presence of the password will make it less secure; SHA1 is an avalanching hash. I do think the hash of the UserModel is an improvement. |
Are you guys suggesting something like? |
Given that It's also worth considering the statistics here. Hashkiller has only 44E+9 of the possible 1.46E+48 hashes yet if we're only hashing usernames there will be far fewer permutations given assumptions about username construction and depending on configuration, usernames may be visible anyway. So there are many easier ways to get in. Also you may like to check out the RPC to make sure that's not allowing information leakage which could such aid attacks. ;) Probably the most appropriate solution would be to generate a collection of random bytes and use that. It could be useful to allow the |
True, but actually that would be a good thing because permission changes should invalidate the existing cookie and create a new one. |
Gitblit uses server-side sessions. The cookie is used to identify an account, but nothing more. I'm pretty sure that permissions are updated on each incoming request so if an admin changes them, the user should immediately see those changes without a logout/login cycle. |
I also have an interest in tightening security for Gitblit, so I would advocate for an change of cookie creation. Can we close this PR in favour of #1116 which uses only a random value? |
Closing this pull request in favour of new pull request #1116 which uses a pure random cookie. |
No description provided.