Skip to content

Conversation

slingamn
Copy link
Member

We were checking the login throttle at the beginning of every SASL conversation. This had several problems:

  1. Pidgin (on Windows?) tries every mechanism in order, regardless of the CAP advertisement. It would use up the default throttle allowance trying unsupported mechanisms like CRAM-MD5.
  2. The throttle was actually checked twice for AUTHENTICATE PLAIN (once at the start of the conversation and once in AuthenticateByPassphrase).

The general pattern here is that we should check the throttle every time we do something "expensive" (bcrypt verification, send a reset email) or "dangerous" (anything that could lead to a bruteforce attack on passwords). Therefore, delete the check from the AUTHENTICATE handler, and add one at the beginning of the SCRAM conversation to replace it.

We were checking the login throttle at the beginning of every SASL
conversation. This had several problems:

1. Pidgin (on Windows?) tries every mechanism in order, regardless of
the CAP advertisement. It would use up the default throttle allowance
trying unsupported mechanisms like CRAM-MD5.
2. The throttle was actually checked twice for AUTHENTICATE PLAIN
(once at the start of the conversation and once in AuthenticateByPassphrase).

The general pattern here is that we should check the throttle every time we
do something "expensive" (bcrypt verification, send a reset email) or
"dangerous" (anything that could lead to a bruteforce attack on passwords).
Therefore, delete the check from the AUTHENTICATE handler, and add one at
the beginning of the SCRAM conversation to replace it.
@slingamn slingamn added this to the v2.14 milestone May 26, 2024
@slingamn
Copy link
Member Author

Reported by donio and pathof

@slingamn slingamn added the bug label May 26, 2024
@slingamn slingamn merged commit 5ee32cd into ergochat:master May 28, 2024
@slingamn slingamn deleted the throttle.1 branch January 28, 2025 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant