Live data from Hacker News

MTOTP: Wouldn't it be nice if you were the 2FA device?

github.com

61–70 of 116 posts

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#61
post #35

Earlier quoted context omitted.

Are there any mainstream websites which only allow a single TOTP token to be enrolled? I can't remember having ever run into that issue. I do recall it occasionally being an issue with Passkeys, though. The non-disclosure is indeed neat, but the same can be achieved with a password. For example: generate public/private keypair on account creation. Encrypt private key with user password. Store both on server. On auth,…

You don't need to involve a private key there. Modern password authentication algorithms never reveal the bare secret (outside of initial registration ofc). For example, PAKE uses Diffie-Hellman coupled with the (salted) password hash to independently derive the same session key on both sides of the connection. AFAIK the primary technical concerns are insecure storage by the server (bad hash or salt) or keylogging of…

Ah, of course! I did initially consider DH as example, but discounted it because of the need for the server to store the plaintext password - the fact that you can just hash it first completely slipped my mind.

I completely agree about phishing being the main attack vector. However, I do think malware is a not-too-distant second - which makes having a single device contain both your password and TOTP secret a Really Bad Idea. Having not-perfectly-secure TOTP codes only your phone and a password manager DB only on your desktop is a pretty decent solution for that.

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#62

Earlier quoted context omitted.

If a factor is "something you own", it is by design that if you lose and no longer own it then you can't pass that check.

Not true. There is no requirement that the user be incapable of cloning or recreating the possession. That's an additional constraint that some parties choose to impose for various reasons (some understandable, some BS). In the end it's all just hidden information. The question is the difficulty an attacker would face attempting to exfiltrate that information. Would he require physical access to the device? For how l…

That's like saying "There is no requirement that the user doesn't tell their password to other people - all that matters is that the user remembers it".

The "additional constraint" is the entire point. You can't get rid of it without seriously degrading your security.

For example, a TOTP secret stored in a password manager will be leaked at the same time as the password itself when the password manager is compromised - which once again allows for impersonation by an overseas attacker.

And when you're using a password manager a leak on the website side is not a real threat, as yours is unique per-website and contains enough randomness to not be guessable if its hash leaks.

If anything, TOTP is the weaker factor here, as the website needs access to the raw TOTP secret to verify your code - which means a compromised website is likely going to mean its stored TOTP secrets are leaked in plaintext!

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#63

Earlier quoted context omitted.

> In this case the device is just your brain And that makes it a password (i.e. the primary factor, not a second factor). The whole point of a second factor is that it's not trivially cloneable (hence why, for example, SMS is a poor form of 2FA in the presence of widespread SIM cloning attacks).

No, the defining characteristic of a password is also how it is used: it is communicated in the clear to the verifier, thus revealing it to eavesdroppers. It is highly non-trivial to clone the knowledge in someone's brain if they never openly communicate the mTOTP secret but only do the computations in their head.

Not true. There are lots of authentication schemes where the plaintext password is never communicated. This becomes rather crucial when the client doesn't know for sure yet what the identity of the other side is. See for example wifi encryption.

Cloning the knowledge in someone's brain is fairly easy. You just need a wrench.

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#64
Yes! I've been thinking about a similar idea in October, using a "keyed hash" of the challenge computed with playing cards. I have no idea how secure this is, but the concept itself is exciting: the mental labor might function as a useful anti-coercion/fishing tool.

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#65
post #62

Earlier quoted context omitted.

Not true. There is no requirement that the user be incapable of cloning or recreating the possession. That's an additional constraint that some parties choose to impose for various reasons (some understandable, some BS). In the end it's all just hidden information. The question is the difficulty an attacker would face attempting to exfiltrate that information. Would he require physical access to the device? For how l…

That's like saying "There is no requirement that the user doesn't tell their password to other people - all that matters is that the user remembers it". The "additional constraint" is the entire point . You can't get rid of it without seriously degrading your security. For example, a TOTP secret stored in a password manager will be leaked at the same time as the password itself when the password manager is compromise…

> That's like saying "There is no requirement that the user doesn't tell their password to other people - all that matters is that the user remembers it".

... yes? I wholeheartedly agree with that statement so I'm really not sure what your point is. I have shared passwords with family members in the past. It works when it works and it doesn't when it doesn't.

> The "additional constraint" is the entire point.

I believe I already refuted that. Every practical implementation will have weaknesses. Being vulnerable to a greater number of attack vectors does not disqualify the method. All that matters is that the method works as intended for the attack vectors of interest.

I can bypass the lock on my front door by breaking a window. That doesn't mean that the thing on my front door doesn't qualify as a physical lock. It just means that my security model is vulnerable to certain attack vectors. That might or might not be a problem.

> You can't get rid of it without seriously degrading your security.

Whether or not my security is degraded depends on the extent to which the attack vectors the "additional constraint" was defending against are relevant to me. Writing my password on a post-it note and sticking it to my monitor degrades my security if the attack vector is someone breaking and entering my home. However it does not degrade my security even slightly if the only attack vector I care about is a stranger on a different continent illicitly logging into the associated account.

In general your thinking on this topic seems overly rigid and dogmatic. Security practices exist only to serve real world usecases. The expected attack vectors matter. So does user inconvenience. Something that is less secure but more convenient can often be the "more correct" solution in the real world. This is no different than how businesses will often choose to implement processes with well known flaws coupled with a response plan or insurance policy. For example shipped software often has bugs that were already known prior to release.

> a TOTP secret stored in a password manager will be leaked at the same time as the password itself when the password manager is compromised

Agreed. I went out of my way earlier to acknowledge the vulnerability to additional threat models.

> when you're using a password manager a leak on the website side is not a real threat

Well sure, but how are you going to get the vast majority of your users to use a password manager? They can always choose not to and there's approximately nothing you can do to reliably detect that.

You could mandate switching to a key based solution but then you'll get lots of complaints and maybe even lose customers. Or you could augment passwords with something else. TOTP is reasonable. So are SMS or email codes. Despite not being as secure or foolproof as a hardware token those solutions are sufficient for many scenarios.

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#66
post #40
post #30

Earlier quoted context omitted.

You are supposed to store the password in a Secure Enclave, which you can only query for the current token value. You are also supposed to immediately destroy the QR code after importing it. As I already mentioned, the fact that people often use it wrong undermines its security, but that doesn't change the intended outcome.

IMO if it is possible to use a system wrongly which undermines its security, it is already broken.

I mean, TOTP is one of the earliest 2 factor systems, and works least well.

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#67
post #53

Earlier quoted context omitted.

Thinking about it, there are only 10 billion different keys and somewhat fewer sboxes. So given a single pass code and the login time, you can just compute all possible pass codes. Since more than one key could produce the same pass code, you would need 2 or 3 to narrow it down. In fact, you don't even need to know the login time really, even just knowing roughly when would only increase the space to search by a bit.

Also @MattPalmer1086 the best solution for this I have now is to have several secret keys and rotate usage. Would be nice to have some additional security boosts.

Key rotation among a set of keys only partially mitigates the issue (have to obtain more samples).

It has it's own synch problems (can you be sure which key to use next and did the server update the same as you, or did the last request not get through?).

This post on security stack exchange seems relevant.

https://security.stackexchange.com/questions/150168/one-time...

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#68

Earlier quoted context omitted.

> Passwords are entered in plain text into fields that you trust, but that also means that passwords can be stolen The only difference here is that you are hashing the password in your head, instead of trusting the client to hash it for you before submitting it to the server. Which makes the threat model here what, exactly? Keyloggers, or login pages that use outdated/insecure methods to authenticate with the server?

Yes, but also plain guessing since passwords are usually chosen by the user and not generated by the server like TOTP secrets. Also phishing attacks tricking users into entering their passwords in fake login pages, and stolen password databases.

> Yes, but also plain guessing since passwords are usually chosen by the user and not generated by the server like TOTP secrets.

If we were talking a >256-bit secret, I'd buy this, but in the human-calculated case I don't see how it actually helps with this, because you've substituted a ~8 character password for a 6 digit number, which is significantly less search space to brute-force.

> Also phishing attacks tricking users into entering their passwords in fake login pages

yes, this is more-or-less a subset of the "keylogger/insecure login page" case

> and stolen password databases

There's still a server-side TOTP secret database to be stolen, no? And normally that would be hard to reverse-engineer the actual secret from, but again, you've shrunk the search space down to 1,000,000 entries, which is trivial to brute force.

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#69

Earlier quoted context omitted.

> In this case the device is just your brain And that makes it a password (i.e. the primary factor, not a second factor). The whole point of a second factor is that it's not trivially cloneable (hence why, for example, SMS is a poor form of 2FA in the presence of widespread SIM cloning attacks).

No, the defining characteristic of a password is also how it is used: it is communicated in the clear to the verifier, thus revealing it to eavesdroppers. It is highly non-trivial to clone the knowledge in someone's brain if they never openly communicate the mTOTP secret but only do the computations in their head.

> No, the defining characteristic of a password is also how it is used: it is communicated in the clear to the verifier

This is only true if the verifier lives on your local terminal - otherwise we use an encrypted channel to transmit to the verifier, or do the exactly same type of timed-salted-hash scheme used here to transmit without revealing the password.

Re: MTOTP: Wouldn't it be nice if you were the 2FA device?

#70
Interesting idea but I don't think my users will grok this :)

The worst thing about it is that people will go like "uuuh naaaah" and will just grab a random app off the play store and put their code in it. Now you are leaking secrets to whatever random app they use.

Post reply on HN