Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid brute force by locking out after failed attempts #13

Open
chillu opened this issue Oct 25, 2018 · 2 comments
Open

Avoid brute force by locking out after failed attempts #13

chillu opened this issue Oct 25, 2018 · 2 comments

Comments

@chillu
Copy link

chillu commented Oct 25, 2018

Currently TOTPAuthenticator registers a failed login only when no token is present. If the token is wrong, it throws and redirects. https://github.com/elliot-sawyer/totp-authenticator/blob/master/src/Authenticators/TOTPAuthenticator.php#L46

That's opening up the implementation to brute force. The time window of 30s is irrelevant if you get infinite tries (bound by server capacity).

/cc @Firesphere

@chillu chillu changed the title Avoid brute force by registering failed logins Avoid brute force by locking out after failed attempts Oct 29, 2018
@brynwhyman
Copy link
Collaborator

Given that this module relies on the bootstrapmfa module, could we look at handling excessive (brute forced) requests in that, and build it so authentication modules like this just consume it?

@robbieaverill
Copy link
Collaborator

robbieaverill commented Nov 8, 2018

It looks like we can add this to solve this:

                if ($user_submitted_key !== $key) {
+                   $member->registerFailedLogin();
                    $result->addError(_t(self::class . '.TOTPFAILED', 'TOTP Failed'));
                }

This way the core mechanism for handling lockouts for repeated failed login attempts can be used.

Also need to validate that this works of course. It may need some extra conditions checking for isLockedOut() etc.

@robbieaverill robbieaverill added type/bug Something isn't working affects/v4 change/minor effort/medium impact/high type/enhancement New feature or request and removed type/bug Something isn't working labels Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants