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

Fix user enumeration attack vulnerability in /auth/forgotpw #92

Closed
xx4h opened this issue May 7, 2021 · 3 comments · Fixed by #148
Closed

Fix user enumeration attack vulnerability in /auth/forgotpw #92

xx4h opened this issue May 7, 2021 · 3 comments · Fixed by #148

Comments

@xx4h
Copy link
Contributor

xx4h commented May 7, 2021

Currently it is possible to find valid user accounts by bruteforcing /auth/forgotpw.

I understand the convenience of being always told what the problem is (from the user perspective), but at least some of us (or maybe even the most of us) use mokey to provide a self-service portal to an unsecure network or even expose it to the internet, which is why we should at least make this configurable.

Would be happy to get some more thoughts and opinions on this.

Cheers
- xx4h

@aebruno
Copy link
Member

aebruno commented May 7, 2021

Agreed. This should probably always return success (from the user perspective) and just do nothing on the backend if and invalid user account was provided. Having this configurable would be nice. We do have some rudimentary rate limiting in mokey as well which makes brute forcing forgotpw slightly more challenging. If enabled, by default it only allows 15 POST requests per hour.

@xx4h
Copy link
Contributor Author

xx4h commented Sep 21, 2024

Quite some time passed, since i initially raised that 😅

Unfortunately now it has become even easier to find valid user accounts, as we directly get feedback about if a username is valid or not on the /auth/login page.

@aebruno
Copy link
Member

aebruno commented Sep 21, 2024

Quite some time passed, since i initially raised that 😅

Unfortunately now it has become even easier to find valid user accounts, as we directly get feedback about if a username is valid or not on the /auth/login page.

We've found the current login flow to be a bit easier for end users with the trade off that it does expose the potential for username enumeration attack. If this is a concern for your site the recommendation is to enable rate limiting which would mitigate this attack somewhat as the attacker could only do a limited number of posts per hour.

We are certainly open to hearing alternative implementation suggestions or other mitigation strategies if you have any.

xx4h added a commit to xx4h/mokey that referenced this issue Sep 22, 2024
option "accounts.check_user"

Default "true", to reflect the current default behaviour of mokey

fix ubccr#92
xx4h added a commit to xx4h/mokey that referenced this issue Sep 22, 2024
option "accounts.check_user"

Default "true", to reflect the current default behaviour of mokey

fix ubccr#92
xx4h added a commit to xx4h/mokey that referenced this issue Sep 23, 2024
option "accounts.check_user"

Default "true", to reflect the current default behaviour of mokey

fix ubccr#92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants