ext/standard: notice on long passwords in bcrypt - #23076
Conversation
Bcrypt supports passwords up to 72 characters. The remainder is ignored. Earlier proposed here: - https://news-web.php.net/php.internals/75692 - https://wiki.php.net/rfc/password_hash_spec Bcrypt truncation can result in serious security bugs: - https://pentesterlab.com/blog/freshrss-bcrypt-truncation-auth-bypass - https://www.invicti.com/blog/web-security/okta-vulnerability-bcrypt-auth
|
This could also apply to |
|
@nikic @narfbg @ircmaxell I am looking into this again, and you seemed to have objected last time. Do you feel the same now? This is mostly for the case where some static string is prepended to the password before being passed to |
|
Thanks for the ping, @Sjord. I do still think that warnings would do more harm than good. However, I might not be against a fail-closed approach where an exception is thrown. Not to say that I'd outright support that (the BC break can be too big a price to pay) but it would solve most of the problems I have with the warning idea. |
Bcrypt supports passwords up to 72 characters. The remainder is ignored.
Earlier proposed here:
Bcrypt truncation can result in serious security bugs: