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

Security: Use password_hash() rather than hash() #7

Closed
PhrozenByte opened this issue Sep 13, 2017 · 1 comment
Closed

Security: Use password_hash() rather than hash() #7

PhrozenByte opened this issue Sep 13, 2017 · 1 comment

Comments

@PhrozenByte
Copy link

$users = $this->search_users($name, hash($this->hash_type, $pass));

hash() is no password hashing function (at least not as-is)! Even more important: Never use a password hash function without salt. Use password_hash() instead.

Unfortunately password_hash() requires >= PHP 5.5. If you still want to support PHP 5.3 and PHP 5.4 (as Pico does), you can use https://github.com/ircmaxell/password_compat. You might want to take a look at how Pico's official admin plugin (still work in progress) takes care of this:

@PhrozenByte
Copy link
Author

IMO this shouldn't be optional, using hash() without a salt and without a huge number of hashing rounds makes brute force attacks - even with long passwords - very easy. password_hash takes care of this.

Simply move your PicoUsers.php together with ircmaxell/password_compat's password.php to a new PicoUsers/ directory and do a require_once('password.php').

@nliautaud nliautaud reopened this Sep 14, 2017
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

2 participants