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

6 digits passcode can be brute forced #213

Closed
adri opened this issue Sep 6, 2022 · 3 comments
Closed

6 digits passcode can be brute forced #213

adri opened this issue Sep 6, 2022 · 3 comments
Milestone

Comments

@adri
Copy link

adri commented Sep 6, 2022

Hi! Great work so far. I saw that you use a 6 digit passcode which has just 1 million possibilities. https://github.com/teamhanko/hanko/blob/main/backend/crypto/passcode.go

Without a rate limit this can be brute forced by trying out all combinations.
I saw that rate limits have to be added by the user, however most IP based rate limits can be bypassed using proxy services. Using only a rate limit is only one layer of defense.

A more secure solution would be to use letters as well so the code is not so easily guessable. That way there is some “defense in depth”.

@irby
Copy link
Collaborator

irby commented Sep 14, 2022

I agree passcodes can be brute-forced. The backend passcode handler does invalidate (and erase) passcodes after 3 incorrect guesses, but I don't think rate limiting is a bad idea to prevent malicious users spamming the API until they get a right passcode ID and token combination.

@FlxMgdnz FlxMgdnz added this to the 1.0 milestone Sep 14, 2022
@FlxMgdnz
Copy link
Member

FlxMgdnz commented Oct 6, 2022

We'll address this with #24

@like-a-bause
Copy link
Collaborator

The Passcode init endpoint can now be protected with some basic fixed-window rate limiting which combines user-id and IP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants