1

It is my understanding that the scratch codes that Google Authenticator provides in case you lose your phone are a one-time password but a password nonetheless. If an attacker gains access to them (in addition to your main password or key), can't he log in and then reset Authenticator, synchronizing it with his own phone to give himself permanent access? How is using Authenticator for MFA any better than using two fixed passwords or using single-factor authentication but appending the scratch codes to your original password?

In case context matters, I have an EC2 instance that I've configured to require both an ssh key or password and a code from Authenticator when I ssh into it.

1

The idea behind two factor authentication is to use something you know and something you own to authenticate.

In your example you're usually using your normal password (something you know) and your phone (something you own). In the case of backup codes, they should be downloaded once and printed off in case you lose/forget your phone as something you own. However Google allows you to view them again, probably as users were losing them. Ideally a new set of backup codes would be generated in this case.

If an attacker gains access to them (in addition to your main password or key), can't he log in and then reset Authenticator, synchronizing it with his own phone to give himself permanent access?

Yes he can which is why a strong password in the first place is a good idea. As Google asks for this when making changes to the way you sign in. If an attacker has stolen your session or is performing a man in the browser attack, they still need your password to make changes. If they have your password it's game over.

How is using Authenticator for MFA any better than using two fixed passwords or using single-factor authentication but appending the scratch codes to your original password?

Authenticator is better as it isn't a static password appended together, essentially making it a single factor. Use of one time passwords makes the opportunity for an attacker to use them much smaller. Backup codes are also one time, once you've used one you can't use it again.

So what's the best way of using authenticator?

  • Don't use backup codes - This reduces flexibility however.
  • Get a hardware token - As Google Authenticator is just implementing OATH TOTP and HOTP you can get a programmable OATH hardware token. This reduces the attack service further as it's a completely disconnected token, an attacker can't use your phone for authentication.

What about other authentication methods?

Personally I use a Yubikey together with Duo Security Linux Integration for SSH authentication. It works a treat.

You can also use a Yubikey directly with Google Authenticator.

Finally, like most things in life you have to compromise. Some authentication can be really easy to use at the expense of some security, others can be annoyingly difficult to use but are very secure. Try and figure out what matters to you and find the best compromise.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.