aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Security
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-10-08 15:04:38 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2020-10-08 19:51:13 +0200
commit8fae2beeceffcf67f31a93ba759ecddc06f54554 (patch)
tree5547a67232255786724928ccf9ebab2b7800e7e2 /lib/private/Security
parent6c1b542def8ba59306c4c539c0e56c0794389873 (diff)
downloadnextcloud-server-8fae2beeceffcf67f31a93ba759ecddc06f54554.tar.gz
nextcloud-server-8fae2beeceffcf67f31a93ba759ecddc06f54554.zip
Limit throttler to 48 hours
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Security')
-rw-r--r--lib/private/Security/Bruteforce/Throttler.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Security/Bruteforce/Throttler.php b/lib/private/Security/Bruteforce/Throttler.php
index 377d9c309b4..e1d9127a7bb 100644
--- a/lib/private/Security/Bruteforce/Throttler.php
+++ b/lib/private/Security/Bruteforce/Throttler.php
@@ -226,6 +226,11 @@ class Throttler {
* @return int
*/
public function getAttempts(string $ip, string $action = '', float $maxAgeHours = 12): int {
+ if ($maxAgeHours > 48) {
+ $this->logger->error('Bruteforce has to use less than 48 hours');
+ $maxAgeHours = 48;
+ }
+
if ($ip === '') {
return 0;
}