nextcloud / bruteforcesettings

🕵 Allow admins to configure the brute force settings
https://apps.nextcloud.com/apps/bruteforcesettings
GNU Affero General Public License v3.0
49 stars 13 forks source link

Handle expired links better to avoid false positives #562

Open joshtrichards opened 8 months ago

joshtrichards commented 8 months ago

Currently you only need a handful of users who click on an expired link and their IP range gets on the naughty list and blocked real fast

Originally posted by @DanScharon in https://github.com/nextcloud/bruteforcesettings/issues/4#issuecomment-1596995344

joshtrichards commented 5 months ago

Related: nextcloud/server#42614

DaphneMuller commented 1 month ago

@Fenn-CS or @sorbaugh is there any update here? the bug is reproducible as communicated by Anupam. Ticket is missing the SLA soon (1 working day left)

Fenn-CS commented 1 month ago

Being looked into currently. @DaphneMuller

DaphneMuller commented 1 month ago

@Fenn-CS please let me know a confirmation of in which release the fix will be available. We can then inform the customer. Thanks!

Fenn-CS commented 1 month ago

I’ve been able to somewhat reproduce this issue, where I encounter a 429 "Too Many Requests" response.

Screenshot from 2024-08-22 14-59-42

However, I’m not entirely sure if this scenario mirrors the situation where tens or hundreds of users might be blocked, particularly when it’s a case of multiple users attempting to access the same URL repeatedly from within the same network.

In my reproduction case, the 429 error occurs when a single user (apparently as sometimes the IPs can be shared) repeatedly visits the URL within a short time frame. This suggests that the rate-limiting mechanism might be getting triggered even under normal usage conditions. It's important to note that this issue might not be directly related to sharing itself but rather a situation that is more like to be observed frequently in sharing due to how often shared links are revisited.

Given that shared links are more likely to be accessed multiple times, especially over time, should we consider making an exception or adjusting the rate-limiting rules specifically for these cases?

cc: @nickvergessen @come-nc @blizzz

DanScharon commented 1 month ago

I’ve been able to somewhat reproduce this issue, where I encounter a 429 "Too Many Requests" response. [...]

However, I’m not entirely sure if this scenario mirrors the situation where tens or hundreds of users might be blocked, particularly when it’s a case of multiple users attempting to access the same URL repeatedly from within the same network.

Please test with IPv6. In case of IPv6, a single address from a /64 segment running into the bruteforce protection blocks the whole /64 segment (in our case: every wifi user on campus).

nickvergessen commented 1 month ago
sorbaugh commented 1 week ago

Talking with @icewind1991 it seems the most pragmatic approach would be indeed to add a grace period for links that used to be valid and remove bruteforceprotection for those.