diff options
author | Joas Schilling <coding@schilljs.com> | 2022-07-07 09:35:14 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-07-07 09:35:14 +0200 |
commit | 8274c05e190a8d3b2f32925dda90a4b47f137077 (patch) | |
tree | 4d2910d37768f6d855c7293285f9f94723a706c3 /lib/private/Security | |
parent | b51cb233816bc46902834e068975c5e2bad2c188 (diff) | |
download | nextcloud-server-8274c05e190a8d3b2f32925dda90a4b47f137077.tar.gz nextcloud-server-8274c05e190a8d3b2f32925dda90a4b47f137077.zip |
Only ignore attempts of the same action
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Security')
-rw-r--r-- | lib/private/Security/Bruteforce/Throttler.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Security/Bruteforce/Throttler.php b/lib/private/Security/Bruteforce/Throttler.php index c47d102b881..e37746eb6a2 100644 --- a/lib/private/Security/Bruteforce/Throttler.php +++ b/lib/private/Security/Bruteforce/Throttler.php @@ -65,8 +65,8 @@ class Throttler { private LoggerInterface $logger; /** @var IConfig */ private $config; - /** @var bool */ - private $hasAttemptsDeleted = false; + /** @var bool[] */ + private $hasAttemptsDeleted = []; public function __construct(IDBConnection $db, ITimeFactory $timeFactory, @@ -225,7 +225,7 @@ class Throttler { $maxAgeHours = 48; } - if ($ip === '' || $this->hasAttemptsDeleted) { + if ($ip === '' || isset($this->hasAttemptsDeleted[$action])) { return 0; } @@ -303,7 +303,7 @@ class Throttler { $qb->executeStatement(); - $this->hasAttemptsDeleted = true; + $this->hasAttemptsDeleted[$action] = true; } /** |