From 35cc27ed2139d4182f43f79f0773d9b2df8e7141 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 14 Sep 2022 14:04:13 +0200 Subject: [PATCH] dont try email login if the provider username is not a valid email Signed-off-by: Robin Appelman --- lib/private/User/Session.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 7aea219b608..8f910113078 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -461,6 +461,9 @@ class Session implements IUserSession, Emitter { if (!$this->login($user, $password)) { // Failed, maybe the user used their email address + if (!filter_var($user, FILTER_VALIDATE_EMAIL)) { + return false; + } $users = $this->manager->getByEmail($user); if (!(\count($users) === 1 && $this->login($users[0]->getUID(), $password))) { $this->logger->warning('Login failed: \'' . $user . '\' (Remote IP: \'' . \OC::$server->getRequest()->getRemoteAddress() . '\')', ['app' => 'core']); -- 2.39.5