Live data from Hacker News

6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

lukeplant.me.uk

31–40 of 42 posts

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#31

Its a shame the TOTP standard does nor support variable code length, 8 symbols seems to be better for high value accounts but still usable

I wish TOTP supported a PIN. That omission makes it pretty useless for high security applications.

You want your secret to have a secret? Several apps that provide time based one time password storage/management can also be secured with bio-metrics, pins or passwords (Aegis, MS Authenticator). Are you specifically thinking physical tokens only?

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#32
post #21

Earlier quoted context omitted.

One problem with the two-step approach of only prompting for 2FA after successful auth is it leaks a lot of information - an attacker can confirm that they got the right password, or even just that the account exists and has 2FA enabled. For TOTP-based 2FA, it would ideally prompt for all three (username/password/TOTP code) immediately, not indicating which part of auth failed. This may not always be desired, for exa…

> In those cases, at the very least always prompt for 2FA for accounts that require it, regardless of if password auth succeeded or not. Don’t tell the user if it was the password or TOTP code that failed. This still leaks that the account exists and has TOTP enabled tho. You have to choose if leaking the correctness of the password, or allowing DoS of a login, unless all the accounts have the same MFA.

> This still leaks that the account exists and has TOTP enabled tho.

You could mitigate that by prompting for an OTP code on a random but stable subset of nonexistent accounts -- for example, by hashing the provided username with a server-side secret and requesting an OTP if the hash starts with a zero.

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#33
post #21

Earlier quoted context omitted.

One problem with the two-step approach of only prompting for 2FA after successful auth is it leaks a lot of information - an attacker can confirm that they got the right password, or even just that the account exists and has 2FA enabled. For TOTP-based 2FA, it would ideally prompt for all three (username/password/TOTP code) immediately, not indicating which part of auth failed. This may not always be desired, for exa…

> In those cases, at the very least always prompt for 2FA for accounts that require it, regardless of if password auth succeeded or not. Don’t tell the user if it was the password or TOTP code that failed. This still leaks that the account exists and has TOTP enabled tho. You have to choose if leaking the correctness of the password, or allowing DoS of a login, unless all the accounts have the same MFA.

Yes, maybe I should have made that compromise more clear. The alternative I see would be to enforce some form of 2FA for all accounts and always prompt for 2FA. Depending on the system it may make sense.

It’s still way better than leaking a successful password auth.

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#34
post #7

This article is pointless clickbait - what percent of systems don't have some sort of throttling or lockout after X number of bad guesses - damn few I would say. Even the most basic, low budget systems I have developed or worked on have throttling rules in place - many with exponentially increasing timeouts that would prevent this sort of attack. If a website/system does not implement even the most basic security pra…

Given the number of services that turned out to use plaintext or trivial password hashing (e.g. MD5), I would bet there are a bunch of services out there that do not effectively limit OTP attempts.

It’s been a long time since I did any work on a real authentication system — since before TOTP was common, anyway. I appreciated the post and found it interesting.

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#35
post #31

Earlier quoted context omitted.

I wish TOTP supported a PIN. That omission makes it pretty useless for high security applications.

You want your secret to have a secret? Several apps that provide time based one time password storage/management can also be secured with bio-metrics, pins or passwords (Aegis, MS Authenticator). Are you specifically thinking physical tokens only?

If you need to conform with higher NIST assurance levels, a one time password generator needs to have a secret as well.

Commercial solutions support this with challenge/response tokens or PINs. I’d love to see an OSS solution.

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#36
post #7

This article is pointless clickbait - what percent of systems don't have some sort of throttling or lockout after X number of bad guesses - damn few I would say. Even the most basic, low budget systems I have developed or worked on have throttling rules in place - many with exponentially increasing timeouts that would prevent this sort of attack. If a website/system does not implement even the most basic security pra…

MS had a 7 digit code, and some rate limiting, but even that was insufficient: https://thezerohack.com/how-i-might-have-hacked-any-microsof...

(7 digit reset code for forgot password flows)

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#37
post #31

Earlier quoted context omitted.

You want your secret to have a secret? Several apps that provide time based one time password storage/management can also be secured with bio-metrics, pins or passwords (Aegis, MS Authenticator). Are you specifically thinking physical tokens only?

If you need to conform with higher NIST assurance levels, a one time password generator needs to have a secret as well. Commercial solutions support this with challenge/response tokens or PINs. I’d love to see an OSS solution.

Perhaps you could link to these NIST standards?

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#38

Earlier quoted context omitted.

Does it assume that each code is new and not repeated? Because they can def be duplicates.

Still doesn't matter. If you're guessing at random, you have a roughly one in a million chance of getting it right each time. (Actually, the odds are a little better than that, because most TOTP implementations mitigate clock skew by allowing clients to enter codes from a "window" of a few minutes surrounding the current time.)

There is a window of validity (often 30s), and a window of forgiveness (often +- 30s, so the same code will work for 90s), but the standards require only one attempt per window which renders TFA's claim pointless. Except for poor implementations, of course. And once in a million windows it may be 000000 (with 30s windows that will take 347 days assuming even distribution)

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#39

Earlier quoted context omitted.

> In those cases, at the very least always prompt for 2FA for accounts that require it, regardless of if password auth succeeded or not. Don’t tell the user if it was the password or TOTP code that failed. This still leaks that the account exists and has TOTP enabled tho. You have to choose if leaking the correctness of the password, or allowing DoS of a login, unless all the accounts have the same MFA.

> This still leaks that the account exists and has TOTP enabled tho. You could mitigate that by prompting for an OTP code on a random but stable subset of nonexistent accounts -- for example, by hashing the provided username with a server-side secret and requesting an OTP if the hash starts with a zero.

First time I see this idea - I like it!

Re: 6 digit OTP for Two Factor Auth (2FA) is brute-forceable in 3 days

#40
post #7

This article is pointless clickbait - what percent of systems don't have some sort of throttling or lockout after X number of bad guesses - damn few I would say. Even the most basic, low budget systems I have developed or worked on have throttling rules in place - many with exponentially increasing timeouts that would prevent this sort of attack. If a website/system does not implement even the most basic security pra…

If there's a leak of valid usernames or email addresses, for a system that has a few million users, that has a lockout after 10 wrong guesses, then you could gain access to one account for every 10,000 lockouts.
Post reply on HN