-
Notifications
You must be signed in to change notification settings - Fork 108
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
Password hashing helper functions generate salt insecurely #160
Comments
@mammothbane you are welcome to submit a pull request that addresses both. |
I am not a security expert and not sure I correctly understood the comment on ~ 24 bits vs. 32 but I have extended the source range to include digits. If there is a better way to produce a salt value, please submit a PR. I hope this is "secure enough" for most use cases now that we use |
f34a861 introduced a test failure that seemed legit and therefore was reverted. |
My conclusion is this: the salt source characters in the first attempt used some of the characters that differ between URL-safe and standard base64 encoding. This client was using the former while RabbitMQ expects the latter (these values are not passed as part of the URI). The mismatch resulted in |
The password hashing functions depend on
math/rand
to generate the salt, but that package isn't suitable on its own as a source of cryptographic randomness (rabbit-hole doesn't even seed the default source). Salt generation should depend oncrypto/rand
instead.Additionally, restricting the permissible set of values for the salt to just ASCII upper-/lowercase means that the salt only has ~24 bits of effective entropy out of the possible 32.
The text was updated successfully, but these errors were encountered: