Universal 2nd Factor

Universal 2nd Factor (U2F) is an open standard that strengthens and simplifies two-factor authentication (2FA) using specialized Universal Serial Bus (USB), near-field communication (NFC), or Bluetooth Low Energy (BLE) devices based on similar security technology found in smart cards. It is superseded by the FIDO2 Project, which includes the W3C Web Authentication (WebAuthn) standard and the FIDO Alliance's Client to Authenticator Protocol 2 (CTAP2).

While initially developed by Google and Yubico, with contribution from NXP Semiconductors, the standard is now hosted by the FIDO Alliance.

While time-based one-time password (TOTPs) (e.g. 6-digit codes generated on Google Authenticator) were a significant improvement over SMS-based security codes, a number of security vulnerabilities were still possible to exploit, which U2F sought to improve. Specifically:

Comparison of security issues between TOTP and U2F
Issue TOTP U2F
Shared secret
  • Plaintext or QR code transmission of shared secret between server and user
  • Shared secret may be stored in plaintext on server
  • Transmission of public key challenge / response
  • Private key only stored on user hardware device
Man-in-the-middle attack
  • Plaintext code response vulnerable to interception and MITM attack if user has been phished by malicious website
  • Challenge / response is signed (encoding originating domain/website) to prevent interception and reuse
Convenience / eavesdropping
  • Plaintext code is displayed and typed by user manually, visually
  • Prone to mistyping, error
  • Transmission / creation of authentication code is via USB or NFC between hardware key and computer without manual typing steps

In terms of disadvantages, one significant difference and potential drawback to be considered regarding hardware-based U2F solutions is that unlike with TOTP shared-secret methods, there is no possibility of "backing up" recovery codes or shared secrets. If a hardware duplicate or alternative hardware key is not kept and the original U2F hardware key is lost, no recovery of the key is possible (because the private key exists only in hardware). Therefore, for services that do not provide any alternative account recovery method, the use of U2F should be carefully considered.