62 points · by Brajeshwar · 2y ago · 54 comments
1. Credential phishing. Where you store your TOTP secret doesn't matter.
2. OAuth phishing. Where you store your TOTP secret doesn't matter. (This also runs right through FIDO and has been growing in popularity for about a decade now: https://www.trendmicro.com/en_us/research/17/d/pawn-storm-ab...)
3. Data breaches. Where you store your TOTP secret doesn't matter unless your password manager backs up online, that's what gets breached, and the data isn't properly encrypted. Which has happened.
4. Malware. Where you store your TOTP secret matters. This is why U2F and FIDO2 have a user presence test, but the real-world value here is overstated. Malware can always just steal your tokens.
5. Physical access. Where you store your TOTP secret matters. If you care about security though you'll have other measures in place to keep someone with physical access out, which is enough against basically anyone except governments.
Summary: A "true" second factor doesn't really matter. What matters is deciding which scenarios you care about and making sure you have security you'll actually use given those constraints.
Since the TOTP secret is generated by the service and not the user, it prevents credential stuffing. It can’t be reused between sites. If you’re still reusing the same password on every site this is a huge increase in security given how many services are breached.
… but using a password manager and a unique password for each service already does that.
So storing your TOTP secrets alongside your password in your password manager is a _very_ marginal benefit. Prevents a replay of the login if it got captured in the clear and… not much else I can think of.
Where-as a “true” 2FA adds protection against malware, data breaches, physical access, and other risks. That seems like a pretty big benefit for minimal work.
I think for most people using TOTP to avoid the “this shady download/keylogger controls my entire life now” scenario is a pretty clear win on effort versus risk.
So I mostly agree with what you wrote here except the summary. I’d say everyone should be using “true” TOTP where they can, and if you’re going to store them alongside your password they’re little more than security theatre so don’t bother.
They're better than nothing, but outside of enterprise contexts (e.g., enterprise-managed CAC cards and other hardware tokens), I think expecting 2FA to defeat malware, physical access, etc. is too much.
Yep, and "using a password manager with a randomly generated password for each site" already mitigates that just as well.
Barring a user using 1Password and still reusing the same password on every site (why are you using 1Password then?) the only use-case I can think of for storing TOTP tokens alongside your password in 1Password is "the service requires me to use TOTP and I don't care about security".
That said, full disclosure, I've kinda got a bone to pick here because I was a long time 1Password user that was forced to switch off when 1Password removed the ability to have multiple vaults because, as they have said on their support forums, "It's called 1Password and our users only want one password." which was a... mind-boggling response from a company that should be focused on security. And this blog post really doesn't instill much more confidence than that response did.
These days I have my passwords in a KeePassX database. I have my TOTP secrets stored in two places--on my phone in an authenticator app where they're on a very secure platform and practically unrecoverable, and in an entirely separate KeePassX database that has nothing in common with my password database. The only time the KeePassX TOTP database is opened is when I set up a new service and want to add my TOTP secret. It's only there to "break glass in case of emergency" and allow me to recover access if my phone were to become unavailable. It's the right balance of risk _for me_, and in most practical sense two _factor_ authentication.
Stealing a TOTP secret means being able to generate all the tokens. Which allows, for example, to take over an user account and lock the legitimate user out of his account. MITMing a single U2F/FIDO2 allows you to... log in? From one of the system uses to access his account (the one that's compromised).
I've got sites where the FIDO2 to log in and the one to change any security setting require two different security keys. And even when it only requires one security key, the procedure to take over an account requires several tap on the physical security key. A savvy user won't be tricked into tapping his security key for no reason.
Let's take, say, a brokerage account. There's a security key for withdrawals. Without that security key an attacker would be MITMing me by stealing one token could... Consult, what, see my balance and trade for me!? But he still wouldn't be able to steal a cent (and my account ain't big enough to move the market).
The real-world value of an HSM sitting on a device with a tiny attack surface has a lot of value.
The very reason they exist being that compromised computers are a thing. Compromised Yubikeys are not.
You mean token theft? Most sites let you add factors without step-up auth once you're logged in [1]. That's what attackers prefer to do, vs. locking users out, which just gives away the game.
To be clear, end-running around hardware keys with stolen tokens isn't hypothetical. See for example the fallout from the last Okta breach at Cloudflare: https://blog.cloudflare.com/thanksgiving-2023-security-incid.... I make my team use YubiKeys, but there's no upside to being naive about what they are and aren't good for.
Anyway the kinds of sites you're describing are vanishingly few. What people mostly have to deal with are sites like Fidelity's. If you want something other than SMS or push notifications, you have to call Fidelity on the phone, and then all you get is Symantec's bloated wrapper around TOTP.
1. It's even the default in some major identity providers, like Microsoft's (https://learn.microsoft.com/en-us/entra/identity/conditional...). Okta is better, but then their default session length is forever, so moot point.
this is the crux really. Especially when a web based password manager is in use [0], this is not at all within risk tolerance for people really striving for a long-term threat model which they do not need to revisit every couple of years.
Buying multiple hardware tokens and keeping one authenticator/TOTP app on phone is very practical the best you can do and it is secure, loss-proof and will last for a long time. Most services allow you to add multiple types of 2FA devices.
* Something you know (such as a password)
* Something you have (security key, TOTP generator)
* Someone you are (biometrics, fingerprint/face id)
* Somewhere you are (network or geolocation)
Using a password manager app and TOTP generator app on the same phone is clearly a single point of failure and does not add meaningfully to your security compared to just storing the TOTP in the password manager. If your device is compromised the attacker has control of both apps potentially, and very likely the TOTP app does not require an additional password or factor. And unless you use a FIDO2 device for MFA, TOTP is not phishing resistant. You can mitigate these issues though.
However, if you require a specific device to access the password manager by one of the following methods:
* Offline password manager such as KeepassXC (needing the password database file)
* Needing a keyfile (like with KeepassXC or 1Password’s device key)
* Needing to be on a specific network such as VPN (when using a self-hosted password manager like Bitwarden and configuring the firewall to be limited to a wireguard network for example)
Does this count as an additional possession factor or location factor? And if it counts as a possession factor does it meaningfully increase your security posture to have multiple possession factors beyond a FIDO2 key?
You are so wrong. You can log into a password manager from the browser. Now you’re completely pwned.
Let’s compare it to separated 2FA: they pwn my 1Password, but then how the hell are they going to log into my 2FA app? They’d need to breach the 2FA on my Apple/Google account and then again on my Authy, which in practice will mean either a SIM swap or SS7 attack. Only adept threat actors have access to those techniques.
If you just have a pedestrian threat model, store your unimportant 2FA in your password manager, and the really important one’s in a separate 2FA app (2FAS or Authy). 1Password is naturally 2FA by way of its Secret Key system.
Boom. Simple and secure.
Can you elaborate here?
My point was that your phone is a single point of failure if you use it primarily for both your 1password account and your TOTP generator. Compromising the phone gives you access to both apps. And I mention that this can still be mitigated. One of those ways is through adding a password or biometric unlock to your TOTP generator app (as you point out). Or you use a second device like a yubikey. But the point of that paragraph is that combining passwords and totp codes into your password manager is a single point of failure. Separating the passwords and totp but still using just 1 device, can also be a single point of failure.
> Can you elaborate here?
Your point is that if you have both a password manager and a 2FA app, it is functionally as insecure as just having a password manager with integrator 2FA storage. I pointed out how that is worlds apart. If you store your passwords and TOTP together in a password manager, and someone breaches it by say, shoulder peeping, they can just login via the web and now they have full access.
In the case of a separate 2FA app, no such luck for them. They can log in to your password manager, but since they don't have access to your TOTPs, they can't login anywhere (or anywhere important, if you do what I do). This means they can't breach your Apple/Google account or 2FA either.
> Separating the passwords and totp but still using just 1 device, can also be a single point of failure.
But if someone compromises your phone, they are already physically close. At that point can also just yoink your Yubikey out of your bag or pocket, both within less then a meter of your phone :) In general, theorizing about evil maid attacks is useless because any sufficiently motivated threat actor with access to you and your stuff will breach no matter what, and your unfriendly neighborhood hacker will not have sufficient motivation and/or tech to breach you.
If you mean that as: if your drop your phone in a lake on vacation you're SoL.. well, keep a sheet of backup codes printed and hidden or in a vault and bring it with you on vacation. The backup codes aren't enough for any opportunistic thief, as they'd still need your password and/or access to your e-mail.
I find it helpful to think of most “2-step” logins as simply an extension of passwords (one-factor), plus an admission that both users and web sites/apps are completely incapable of following the rules of password management. Users can’t stop reusing passwords, and web sites can’t properly store them and avoid getting hacked.
2 step logins are a method to force users to use a password that changes every 30 seconds, and that password is unique per web site/app. It shouldn’t be seen as a true multi-factor in the traditional sense.
Factors are : Knowledge (password), Inherence (biometrics) & Possession (device).
If you have multiple same factor it remains single factor.
1password itself is only one factor for authentication whatever they offer (password, totp, passkey).
Specifically with 1password I have all three factors you've mentioned above. 1) knowledge - my vault password is memorized, 2) inherence (?) - biometrics used to unlock the vault on trusted devices, 3) possession - my account requires a security key to unlock.
Which becomes far less relevant when using a password manager, because people don't reuse passwords anymore. Password managers also autofill, so eavesdropping on a password is also not possible anymore. One of the primary vectors for compromising passwords is compromising the password manager, which would also compromise the TOTP codes if they were in the password manager. You have much stronger protection against that if your TOTP codes are stored on a separate device.
That said, TOTP is also pretty terrible because does not really protect against phishing (just make a phishing site proxy both credentials).
Hardware keys are the only really secure solution if you consider password manager compromise as part of your threat model.
Remember that password managers are comprisable, just look at LassPass' history.
But there are other scenarios where your password could be stolen without someone getting access to your 1password, for instance if your connection isn't protected and a man in the middle can intercept your password.
In the end, I would argue that having TOTP in the same place as your password is weaker than having it somewhere else, but it's still better than no 2FA
The password becomes known to attackers somehow.
That doesn't mean they have access to my TOTP for the service, even if it's managed by the 1P app.
Loss of 1P's password/key would indeed also mean loss of my TOTP. But then one would have much bigger problems anyway, except if all their 1P passwords also had an external TOTP.
if I hacked a website you’re registered to and you had reused your password I got your password but not totp
if I broke through your computer and password manager then yes it’s all over, but this is not the only threat model and frankly the least i am worried about
- Both in same password manager is obviously storing together.
- Both on same phone, but different apps. There are the subvariants of: password manager and dedicated OTP app or two different password managers. Also there is the consideration where the apps really store the secret data, e.g. system provided vault
- OTP on a separate device
I think the middle option has too many ifs and buts and you could argue that as long as its the same device it's not really separate.
So dedicated OTP token. What should I use?
Cheap mobile phone? Does it need a SIM? Are there dedicated devices? Can they store multiple keys?
https://www.token2.com/shop/category/classic-tokens
https://www.token2.com/shop/category/c301-tokens
https://www.token2.com/shop/category/multi-profile-programma...
Other vendors probably have something like that, I link to what I've personally used.
EDIT: I see the last link has a multi account device and some devices have USB. How does it work, when it says "factory programmed"? I've never seen that I can sync an app to an existing token.
You want something that supports the FIDO2 standard (https://en.wikipedia.org/wiki/FIDO_Alliance#FIDO2). In practise this means you probably want something like a YubiKey.
This means you can also roam those secrets to different devices (as they are on the Yubikey). But it also means that you need to have access to the key whenever you need the OTP!
One caveat is that you can "only" have 32 or 64 accounts per Yubikey (number depending on the version of the key)
Nobody has time to manage/backup multiple keys with the fun game of ‘what account is stored on which key’.
So in that case storing OTP with passwords or don’t does not matter.