Browse Source

Merge pull request #11095 from cakephp/time-based-attack

Ensure input passwords will be hashed even when a user doesn't exist
José Lorenzo Rodríguez 8 years ago
parent
commit
d4a7300a42
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/Auth/BaseAuthenticate.php

+ 3 - 0
src/Auth/BaseAuthenticate.php

@@ -107,6 +107,9 @@ abstract class BaseAuthenticate implements EventListenerInterface
         $result = $this->_query($username)->first();
 
         if (empty($result)) {
+            $hasher = $this->passwordHasher();
+            $hasher->hash((string)$password);
+
             return false;
         }