Skip to content

Commit

Permalink
[SECURITY] Deny authentication bypass using blowfish/md5 encryption
Browse files Browse the repository at this point in the history
Using password hashing methods that are related by class inheritance
can lead to authentication bypass by just knowing a valid username.

Resolves: #84703
Releases: master, 8.7, 7.6
Security-Commit: 17853c536776b6a7332b05b1e10385f4d87868ae
Security-Bulletin: TYPO3-CORE-SA-2018-001
Change-Id: If7a13d3699e217d7d853886b93b84b46f7e22b11
Reviewed-on: https://review.typo3.org/57543
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
  • Loading branch information
ohader committed Jul 12, 2018
1 parent 07d9fe7 commit cbaf75c
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -109,8 +109,8 @@ public function compareUident(array $user, array $loginData, $passwordCompareStr
}
$defaultHashingClassName = \TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::getDefaultSaltingHashingMethod();
$skip = false;
// Test for wrong salted hashing method
if ($validPasswd && !(get_class($this->objInstanceSaltedPW) == $defaultHashingClassName) || is_subclass_of($this->objInstanceSaltedPW, $defaultHashingClassName)) {
// Test for wrong salted hashing method (only if current method is not related to default method)
if ($validPasswd && get_class($this->objInstanceSaltedPW) !== $defaultHashingClassName && !is_subclass_of($this->objInstanceSaltedPW, $defaultHashingClassName)) {
// Instantiate default method class
$this->objInstanceSaltedPW = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(null);
$this->updatePassword((int)$user['uid'], ['password' => $this->objInstanceSaltedPW->getHashedPassword($password)]);
Expand Down

0 comments on commit cbaf75c

Please sign in to comment.