While 2FA is clearly an improvement over only a single factor, is there anything which prevents an adversary presenting a convincing sign-in page which captures both factors?

I realise that technically a MITM attack is different to a Phishing attack, though at a high level they're very similar -- the user is inputting their credentials into an attacker-controlled page and the attacker can then input the credentials onwards into the real page.

1 Answer 1


It depends on the second factor. Most old-school ones (SMS, Google Authenticator, Email code) will not help.

In the case of U2F security keys, the protocol involves a challenge/response and a key pair. The website knows the public key and the security key knows how to generate the private key.

The private key is generated on the fly by the security key using a combination of its own secret (baked into the key) and some parameters. One of the parameters is the origin (in this case, the URI of the website issuing the challenge).

When I first register my key with www.mybank.com (my fancy bank that actually knows what security keys are. ha!) it generated a key pair derived from {private_security_key_data, www.mybank.com, <other parameters>} and gave the public key to the bank.

When I try to sign in later, my security key can solve the challenge because the key pair is generated from the same parameters. However, if I click on a phishing link (eg: www.myfakebank.com) the challenge cannot be completed since the generated key pair will be completely different.

The question now becomes: where does the URI come from? This is provided by the browser's U2F support. In turn, the browser verifies the URI through the standard certificates.

You can find details on this (and a lot more other security features) on Yubikey's overview of U2F.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .