summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-07-07 10:59:54 +0200
committerGitHub <noreply@github.com>2022-07-07 10:59:54 +0200
commit9d3b98ba214ad98c93750e8a392912f4737185f8 (patch)
tree568e60bb79529c783a364a1ce010bf3ce2a7c402
parentff55382c66634fb8a4135039f74cf534d6a3a8eb (diff)
parent8274c05e190a8d3b2f32925dda90a4b47f137077 (diff)
downloadnextcloud-server-9d3b98ba214ad98c93750e8a392912f4737185f8.tar.gz
nextcloud-server-9d3b98ba214ad98c93750e8a392912f4737185f8.zip
Merge pull request #33153 from nextcloud/bugfix/noid/only-ignore-attempts-of-the-same-action
Only ignore attempts of the same action
-rw-r--r--lib/private/Security/Bruteforce/Throttler.php8
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;
}
/**