Show HN: A virtual Yubikey device for 2FA/WebAuthN
github.com
github.com
But USB/IP seems very insecure!
I can see this being very useful for accounts which are effectively throwaway, but they still force you to 2FA. The same is true of TOTP generators.
It‘s always based on the
1) something you know,
2) something you have,
3) something you are
categorisation. Multiple use of a single category still counts as one factor.
Of course if you are like me and keep your TOTP secret in your password manager than it is basically the same factor as a password.
the categorization makes some minimal sense, but basically any additional not-identical "factor" is additional security (though there's obviously a diminishing return because of the complexity-vs-security trade off).
This effectively reduces the 2nd factor to the first, and indeed produces the diminishing return. It's sufficient to hack one system using one method and you compromise both defenses.
The point behind 2nd factor is to provide a second, *independent* layer of protection that would need to be compromised using an entirely different attack.
In the case of the FIDO2 dongles including the Yubikeys the secret isn't even stored on your system, but on the device itself that doesn't even disclose it to your connected system.
But yes, recently I have seen people use password managers that really do both in one single piece of software (a browser extension).
I have a few U2F hardware devices, they are convenient when set up and plugged in, rather inconvenient otherwise :/
Adversary can intercept your login in MITM style, authorize themselves on other machine, just using your machine as proxy, and website you tried to login to would just display error "can't authenticate, try again".
And thangs to fact that key lacks display, attacker can event authenticate to different site, than you are authenticating now.
Trezor is way better device here:
> Phishing protection with on-screen verification. Trezor always displays the URL of the website the user wants to log in to, and what exactly is going to be authorized; therefore it is possible to verify that what was sent to the device is what is expected.
https://wiki.trezor.io/U2F https://wiki.trezor.io/FIDO2
And it supports U2F and FIDO2 (FIDO2 requires more expensive, newer model).
P.S. storing locally in TPM is bit more secure, but still exploitable in case of local privileged code execution.
Or do you mean that this leaves the secrets vulnerable to spyware and stuff? Cause in that case as the other comment says, one could use the TPM.
Which means the something I know is stored in the same places as something I have. Granted it is protected by encryption, and another password, but it definitely increases the attack surface.
If the computer is compromised it becomes much more possible to get access to both of these items than if it was a security key, physical authenticator or even on a different device.
I always think of 2FA as insurance against password theft/leaks. If users don't practice good password practices and use the same password for multiple accounts, for example, when ${next web site to be hacked} leaks all plaintext passwords, you can't just turn around and use that password to access ${another site where I used the same password but have 2FA enabled}. Or I'm logging in to a site from someone else's computer and they have a keylogger. [Obviously this virtual 2FA device wouldn't let me log in in that scenario--but in general, this is another case where the 2FA doesn't have to be rock solid, it just needs to exist if you captured my keystrokes.]
A direct attack on my workstation to steal my virtual 2FA device and my passwords isn't protected by this virtual 2FA device, but that's low in my list of worries overall for people's account security.
This would still protect against phishing, which is probably the bigger risk for the average consumer.
The question is often asked: isn't this less secure than a physical key or touch-id? The answer is yes, but only marginally. If you have no other access to a FIDO authenticator, using a soft authenticator will still be much better than using SMS,TOTP, or Push. Phishing is the most likely way 2fa will fail you, and this is still phishing resistant.
But passkeys are real and you can essentially use them today! The Android/Chrome integration is already quite good. The Chrome/iOS interaction works but is less smooth right now. That's going to get worked out quite quickly so if you have the option to use passkeys you should!
This article is about Yubikeys. Or is it. The project itself is "virtual-fido".
I am sure that it is in Yubico's best interest to promote Yubikeys. And for the enterprise this is probably good. But in my opinion it is a barrier to the adoption of fido. Which is unfortunate.
I wonder if there is a way to use an iPhone or Android as a Yubikey. Oops, I mean Fido device. Anyone have an idea of how to do that? It seems like getting this to run on an Android would be significantly more functional (no extra device) and cheaper.
Krypt.co. It's been bought and turned into a commercial service but their free platform continues to work without issue. Obviously you shouldn't use this as your own way to authenticate and newer standards aren't supported, but I use it every day for my self hosted services (put everything behind Apache OIDC + Keycloak so I don't even need to set a separate password on my self hosted stuff anymore!)
You can use your phone without the syncing part to authenticate other device through a mix of a QR code, a tunnel server, and Bluetooth.
It would be unwise for the author to use the Yubikey trademark in their project name.
That’s basically Google Authenticator.
Didn’t RTFA as I know the algorithm is just one line of python using built-in libraries (which is how I generate passwords minus the time-based part).
Time-based OTP (TOTP), which is what Google Authenticator implements, is not the same as FIDO U2F. They use different underlying mechanisms and have different security properties.
TOTP relies on a shared secret key to generate a matching code on client & server. FIDO U2F uses a challenge-response protocol and incorporates the domain of the requesting website (the domain as verified by TLS certificate) into the challenge to ensure that the response is _only_ valid when it was requested directly from the correct website. This prevents phishing attacks, which TOTP does not.
Yes / sort of. Both systems provide WebAuthn in their native browser, if they have a suitable place to store the private keys, and a way to authenticate the user. On my Pixel 2 it was the fingerprint sensor, on some iPhones I believe it uses FaceID.
In WebAuthn terms this is a platform authenticator, it also provides both factors so you can (but as far as I know no popular sites do) have usernameless one click login, you say I want to log in, your phone sees you have exactly one identity on this site, it provides credentials for that identity, you are now logged in.
The phones also have the same behaviour for apps via their API. This is masked so that rather than being bound to a DNS name like WebAuthn, it's bound to some app identifier, which you "own" on that platform, so a dubious "Better Flashlight" app can't authenticate as the "My Neat App" on the same phone. On the backend you'd adjust your code so that it can handle e.g. SHA256("myneatapp.example") for the web site but also SOME_APPLE_ID for the iPhone app and SOME_GOOGLE_ID for Android.
I've seen this behaviour (not advertised as such) in several apps in the last 2-3 years. The NHS app I use to order routine medication refills is an example. Tap the app, it asks me to log in, presenting a fingerprint symbol, I touch the symbol (this Pixel 6 has the sensor under the glass, I don't love that but I guess the UI is more obvious). Then I follow the exact same UI as if I'd done all the auth steps with fiddly email addresses and passwords.
[Edited to add]
Ooh, bonus feature. If you have Google everything you can literally use an Android phone as a Security Key on your desktop/laptop PC. Chrome sees a web site asked for WebAuthn, sees there's no Security Key plugged into any USB ports, it calls Google, Google sees you have an Android Phone on this account which can do WebAuthn, tells the desktop Chrome about that phone, the desktop does a Bluetooth beacon, "Hey, anybody around here called "tialaramex's Phone" ? Hit me back." If it can see your phone, it proves to Google that it saw your phone, and then the phone lights up with the details of the login you are attempting on the PC and you can authenticate to your phone in the usual way to approve it. Very complicated technically, but the UX is pretty reasonable.
The Bluetooth step is there to help prevent attackers spamming you with login attempts, they would need to be within Bluetooth range of the phone to make that work, so, if that happened you could have them escorted off the property/ arrested/ shot as seems appropriate.
With proper password storage the target server never keeps the password. It course that is difficult to verify. With U2F the secret can't store a secret they can't see.
Every year or so I try to figure out if a 2fa device practically has sufficient support that using it would improve my security. The answer has always been no.
No 2fa device has sufficient support that it could increase the security of my 1password account, which I use on Linux and Android. No 2fa device has sufficient support that it could be used to unlock the lockscreen of any of my devices either.
Edit: There is a way to use a Yubikey to decrypt Linux full-disk encryption. It relies on an abandoned personal GitHub project. Sounds fun, but not sufficiently secure it's worth spending more than $100 to allegedly improve my security with it.
2FA is redundant for unlocking physical devices. Access to the device itself is already a second factor.
The point of 2FA is that someone MUST physically take something from you to gain access, which greatly limits attack vectors. If you use 2FA properly, the only thing you need to worry about for account security is whether you still have your 2FA key on you.
Do you use SSH ? Yubikeys are a fabulous way to store SSH keys.
Also bear in mind that aside from a secure storage mechanism, Yubkeys can also be configured to require pin and/or touch.
Therefore no matter what gets onto your computer, the Yubikey won't provide the answer unless touched.
Yes, but not for anything where keeping the SSH private key more secure than my AWS/DigitalOcean credentials would be useful. And I store those credentials in 1Password, which doesn't have a sufficiently mature integration with Yubikey on Linux or Android.
You can also self host it fully.
I know 1Password can fill TOTP for you, but I like having my security spread across 1Password and Yubikey. In the unlikely event 1Password gets compromised they still need physical access to my computer.
I don't log onto the mac with Yubikey and it has full-disk encryption turned on, so I'm pretty happy with the attack surface.
Both yubikeys are configured to enter the same impossible to memorize password on a press to unlock 1Password, hid mode is supported by every device with a USB ports.
I also use them as an otp second factor when a site requires it.
Finally, they are configured with a x509 certificate that I use as my ssh keys. I generate one key per devices that way the secret never leaves it and I require a pin to unlock the key. For convenience, I use an ssh agent to cache the pin
I could also use them for pgp signature and encryption but I have no use case for that.
Source: I was curious, so I used a camera connection kit to login to Okta with a Yubikey as my MFA last month.
Abandoned?
You do know luks supports FIDO, right?
Here's a small guide on how to do it: https://prose.bentopais.pt/setting-up-trezor-on-arch#luks-un...
You'll also find how to use your key to login to the tty, authenticate to sudo commands and much more.
Remember, 2fa is your second factor. It’s right there in the acronym. It is there to protect against a bad actor stealing your password.
By definition, a second factor won’t improve the ergonomics of logging in.
Many messenger apps already do something like this (using your phone numbers as a first factor and using an optional password for account protection) and IMO the login flow is much easier for services that I don't care about.
Let me register and login with WebAuthn alone and I'll be very happy. You can even use the same logic you're already using for password resets, just re-enroll the FIDO key when someone clicks "I can't log in" and proces access to their email account. Immune to credential stuffing and many other digital attacks that can happen from the other side of the world while you're asleep!
Without that the only benefit of a Yubikey over a strong password saved in a password manager is phishing protection, which I'm not willing to pay that amount of money for.
The place where they shine is when you have already acknowledged that you want (or have been forced by your employer to use) 2FA.
Malware on a device where I'm logged into the service can use that authenticated session to access all the things I want protected.
If the service is hacked, the hacker probably has direct access to everything the password was protecting.
Any well-secured service should protect critical actions with 2fa. “oh, are you sure you want to transfer all your funds? Please re-authenticate first”
If your PC or smartphone is compromised nothing will prevent you from losing control of your accounts.
I know that's a bit wishy-washy, but for example I think I could replace my memorized 1password password with something longer if I never had to enter it from memory, which would only be the case if I could use the Yubikey on all my devices.
If those aren’t enough, I guess yubikeys aren’t the right call for your threat model, which is fine.
Want local authentication? pam_u2f, pam_gpg, pam_x509 are all maintained.
You should be able to set up PAM to use them in that way, without needing any yubikey-specific hijinks. Something like https://discourse.ubuntu.com/t/smart-card-authentication/260...
You can use smartcard in linux as both GPG key, and SSH key (via GPG SSH agent).
Which means leaking your private key for SSH is essentially impossible, as key can be generated on device which means it never leaves it, even if your machine gets compromised
I wish 1Password offered a high security, security key ONLY mode.
I’ve only ever encountered that braindead design with AWS, every other place allows multiple keys.
And I can’t say I find multiple keys cumbersome, it’s simply the same procedure again: Click add, insert key and tap the button. Just twice instead of once.
There's also non-tech users to consider. It's pretty hard to convince users to use a password manager; plenty of people still re-use the same password across sites. It's impossible to prevent that. But it is possible to enforce 2FA for _your_ site.
Password recovery is often done through the phone via SMS (health care/banking) when a 2FA hardware key would be safer. And since you're implementing 2FA, just remove the password, and ask the user to use the 2FA key.
I have a hardware key AND an authenticator app active for the account, but they STILL won't let me send transactions without entering a code sent to my phone number. And actually, not even then, because even though I receive the code fine, they say they can't authenticate me and don't give me a chance to enter it. Yes, it's a VOIP number, but it's been the same VOIP number for the 10 years I've had the account. It's not like it's new.
They needed to send me 3(!) SMS messages in the process. One to get the username (with a valid email address). One more to request to change the password. And one more to actually change the password.
The methods they used to break into the site are often considered "trade secrets".
I would be very interested in a virtual Yubikey backed by Touch ID and the Secure Enclave.
Surely Apple have just answered your wishes with the introduction of Passkeys ?
Anyone here do what I do, a simple encrypted Linux volume + "oathtool" powered script?
Yeah, I know, same device, blah blah. I'm still pretty comfortable with it and I just don't like having this stuff on my phone, which perpetually feels less safe.
https://github.com/browserpass/ https://github.com/tadfisher/pass-otp https://www.passwordstore.org/
As I'm seeing it, "virtual-fido" will let me fake a hardware device and get me so that I only need the laptop for 2FA? Gotta look into this.
I'd like a virtual FIDO2 device where I have to type a password/passphrase when I launch it, and it derives a FIDO2 key from the passphrase. That way, I can have my 2FA device with me in my head, and still get all the anti-phishing benefits of WebAuthn.
Certainly, it's much easier for the passphrase to be stolen/keylogged, but it's a nice option to have.
I’m currently working on trying to expand this out with new features, as most of the work here was actually emulating the USB device which involved a lot of different layers of protocols.
I'm not very familiar with FIDO2, but I thought the private keys for each credential were derived from the single key in the device and the website's domain? Is that not the case? Or are you just generating separate credentials per site and keeping those?
If the latter, couldn't you derive all credentials from a single source of randomness and skip the storage?
If you want to switch to deriving keys this way, you could save the storage space and make the program almost stateless. You'd still need the initial random bits, and those could be stored somewhere (they can probably be just 256 bits or so) or come from the user in the form of a passphrase.
https://www.collabora.com/news-and-blog/blog/2019/06/24/usin...
Granted, this is still just a demo, so it's a long way off from something somebody would regularly use.
Would being able to create virtual devices like this be more useful for testing authentication flows, compared to having physical test devices?
Personally, part of the motivation for creating this was to find a middle ground between the most-secure hardware keys and the least-secure password options for authentication. I would argue that requiring users to have hardware is one of the main reasons we only see YubiKeys as a second factor, even though they benefits outside of being based in hardware (namely the lack of phishable passwords).
I think the main reduction in security is just that the virtual 2FA device is "cloneable" vs a hardware FIDO2 token where IIRC you can't extract the internal secret. So you're getting TOTP levels of 2FA (which also uses a cloneable initialization secret) thru a FIDO2-ish UX which seems like a reasonable thing to want.
I doubt most people would be suspicious if their system prompted them to touch their key, they touched it, the software kept waiting, so they touch it again and it works this time.
Or is that “PassKeys”?
Using an external device for FIDO2 authentication is something I can't add much about. The FIDO2 standard should allow for this and Apple and Google are working to make such a mechanism available if I recall, they made a whole PR thing out of their FIDO2 support a month or two ago. There are apps that can do this as well though I don't know any specific ones for the Apple side of things.