diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php index 112c8000a3ec7..01384dcfcfc4a 100644 --- a/lib/private/User/Database.php +++ b/lib/private/User/Database.php @@ -8,6 +8,7 @@ */ namespace OC\User; +use InvalidArgumentException; use OCP\AppFramework\Db\TTransactional; use OCP\Cache\CappedMemoryCache; use OCP\EventDispatcher\IEventDispatcher; @@ -199,6 +200,9 @@ public function getPasswordHash(string $userId): ?string { } public function setPasswordHash(string $userId, string $passwordHash): bool { + if (!\OC::$server->get(IHasher::class)->validate($passwordHash)) { + throw new InvalidArgumentException(); + } $this->fixDI(); $result = $this->updatePassword($userId, $passwordHash); if (!$result) {