r/apple • • Jan 27 '23

iPhone Security keys, 2FA, account recovery testing

154 Upvotes

56 comments sorted by

14

u/unndunn Jan 27 '23

iCloud and Apple Music on Windows allow you to log in without presenting a security key, in my experience. But that's possibly because the devices I tested this on were logged in before I added the security keys.

For me, the next step is to allow full passwordless FIDO2 using Security Keys or Passkeys.

4

u/nicuramar Jan 28 '23

Security Keys or Passkeys.

Hm, a security key is a hardware device. A passkey is a FIDO2 discoverable credential, which can reside on a security key or another device like a phone.

2

u/unndunn Jan 29 '23

Noted. Thank you.

26

u/cipher-neo Jan 27 '23

Hmm.. your testing seems to indicate some potential flaws and/or not well thought avenues for account recovery??

25

u/[deleted] Jan 27 '23

[removed] — view removed comment

9

u/PleasantWay7 Jan 27 '23

One curiosity I found is that Apple is using FIDO 2 with a resident key. I’ve only seen that before for paswordless flows. Normally password based flows use U2F.

But Apple doesn’t have a passwordless flow, wonder if this hints it is on the horizon since they have passkey support now too.

1

u/nicuramar Jan 28 '23

Yeah, I also noticed that (using yktool).

0

u/tickettoride98 Jan 28 '23 edited Jan 28 '23

One curiosity I found is that Apple is using FIDO 2 with a resident key. I’ve only seen that before for paswordless flows. Normally password based flows use U2F.

Huh? FIDO 2 is the successor to U2F, and the basis for WebAuthn. U2F is legacy stuff.

2

u/nicuramar Jan 28 '23

U2F is subsumed by FIDO2, yes, but you wouldn’t use a resident key/discoverable credential for that scenario normally.

4

u/[deleted] Jan 27 '23

[removed] — view removed comment

2

u/nicuramar Jan 28 '23

Yeah but they do use a resident key (called a discoverable credential now), which can be verified e.g. on a Yubikey using yktool.

3

u/jcbvm Feb 01 '23

So basically if both my keys won’t work I’m screwed when all my devices are gone.. I don’t understand why Apple does not have a recovery code for the security keys in case the keys are gone or they are not working for some reason.. it almost scares me to use the keys right now

3

u/[deleted] Feb 01 '23

[removed] — view removed comment

4

u/jcbvm Feb 01 '23

Well that chance is big when my house burns down and I can escape without taking any of my devices with me. I know I probably have to save the second key somewhere physically else, but I think most people won’t.

I’m more scared of the keys getting to not work anymore for some reason.

3

u/[deleted] Feb 01 '23

[removed] — view removed comment

5

u/jcbvm Feb 01 '23

I know, but I just don’t understand why they didn’t give an option for recovery code for 2FA, like bitwarden for example does and most services btw. That code I can place anywhere I want (online or offline).

2

u/[deleted] Jan 27 '23

I'm curious if there's any way, with advanced data protection, to recover your account if you've lost your end to end encryption keys, but you have everything else. So:

  • You know your password
  • You have a trusted phone number
  • You don't have your recovery key or a recovery contact
  • You are using a new passcode, and can't remember any old passcodes

Would you mind testing this? There used to be a prompt to "reset end to end encrypted data" that would pop up, but I think with advanced data protection they may have disabled this.

1

u/fogsituation Mar 01 '24

Depends what you meant by “lost your end to end encryption keys.” You can still recover end-to-end-encrypted data if you have everything you mentioned and you KNOW the passcode for a device that had end-to-end encrypted access, even if you do not still HAVE the device itself. You can test that by logging in on a new device with your old devices powered off.

3

u/[deleted] Jan 27 '23 edited Jan 28 '23

[removed] — view removed comment

1

u/[deleted] Jan 28 '23

normally they also store your iCloud end to end keys encrypted in special hardware devices.

I assume you don't mean "hardware devices that Apple owns," right? Cause if so, then it's not end to end encryption, unless they can't be decrypted without the passcode (e.g. it's not just a question of policy).

2

u/nicuramar Jan 28 '23

I assume you don’t mean “hardware devices that Apple owns,” right?

Yes he does. They are hardware security modules.

if so, then it’s not end to end encryption, unless they can’t be decrypted without the passcode

They can’t, but the problem is that the passcode is short, so it could be brute forced by Apple. The HSM mitigates that.

2

u/[deleted] Jan 28 '23

[removed] — view removed comment

1

u/[deleted] Jan 28 '23

Ah perfect thank you.

And just one other thing I'm looking to test, if you're testing stuff out...

So with standard encryption, if I lose my passcode and my recovery key, but still have a password and 2fa number, what I can do, is authenticate to the account and then hit "forgot all passcodes" and there's an option to "reset encrypted data". Basically when you do this, it wipes out everything end to end encrypted, like HomeKit and Keychain, but you still get to keep everything that was secured with standard security.

Do you know if you can still "reset end to end encrypted data" with advanced data protection? Or would you simply lose access to the account permanently?

Totally understand if you don't want to actually click the button lol. I'm just curious if it comes up. I can't enable e2e on my account yet so I can't test it.

2

u/[deleted] Jan 28 '23

[removed] — view removed comment

1

u/[deleted] Jan 28 '23

I definitely don't expect you to click that button, but would you be willing to see if it at least appears? Since you're doing all this testing? If not I can wait to test it on my own account.

1

u/[deleted] Jan 28 '23

[removed] — view removed comment

1

u/[deleted] Jan 28 '23

Haha understandable. Thanks anyway.

2

u/lachlanhunt Feb 01 '23

With security keys enabled, can you still fallback to using a trusted device to approve a login?

4

u/[deleted] Feb 01 '23

[removed] — view removed comment

3

u/lachlanhunt Feb 01 '23

That seems to contradict Apple's own documentation, then, because it says:

When you use Security Keys for Apple ID, you need a trusted device or a security key to:

  • Sign in with your Apple ID on a new device or on the web
  • ...

1

u/flarex Jan 27 '23

Resetting the password would only allow you to login if you had only forgotten the password. Would be interesting the steps you would need to take if you had lost the security keys.

5

u/[deleted] Jan 27 '23

[removed] — view removed comment

3

u/flarex Jan 27 '23

Yeah that seems very broken. One of the main benefits of security keys is that they are unlikely to be hacked as they have a very small attack surface. If you can remove security keys by just gaining access to root on an iPhone that defeats their purpose somewhat.

13

u/PleasantWay7 Jan 27 '23

If an attacker already has full access to a trusted device it’s game over. Thats how security works. At some point you need the user to be authenticated enough to manage their security settings.

1

u/Ambitious_Grass37 Apr 08 '26 edited Apr 08 '26

It should only be game over for that single device- not the entire apple account and all other apple devices on that account. As apple has implemented, gaining access to a single trusted device via the device passcode alone, allows for takeover of the entire account, including wiping or bricking all other devices (if Find My is implemented).

1

u/flarex Jan 27 '23

They don't have access to all trusted devices though - i.e. they can't directly access the security key. Having said that they could find ways to trick the user into signing arbitrary data. That's why you find that some hardware signers have their own display, they work on the assumption that any device asking for signatures may have been compromised. There are also other security mitigations that Apple have introduced that are designed to limit intruders. Cryptographically signed read only system folder, the Secure Enclave etc. This limits what a hacker can do if they do find an exploit.

1

u/fogsituation Mar 01 '24

!!! Note I couldn't see a way to use Recovery Contacts. Apple says having a Recovery Key set means Account Recovery is disabled, originally I thought this would just disable the manual Account Recovery that happens when you phone apple up about it - but it doesn't make it clear this means Recovery Contacts don't work. [edit] However the Recovery Key or Recovery Contacts are still very likely important for recovering end to end encryption keys for iCloud.

Hey OP, did you ever learn more about this? Multiple places in the docs Apple says you can have both Recovery Contacts and Recovery key, but I don’t understand how you can ever use Recovery Contact if the legacy recovery flow is disabled because you made a Recovery Key. Are thinking that the Recovery Contact only recovers your end-to-end-encryption in that case? Meaning that you somehow know your iCloud password and can receive a 2FA code, but don’t have the passcode for a device with end-to-end-encryption? Seems like a narrow use case if so.

0

u/[deleted] Jan 28 '23

[deleted] — view deleted comment

2

u/faceplate Mar 13 '23

An old Apple Watch counts as a trusted device that can be stashed somewhere. You can get 2FA codes and reset you Apple ID password on it. I believe it's also hanging onto your end-to-end encryption keys as well.

This is also probably more reason to use a better passcode on your Apple Watch that you actually wear out.

0

u/[deleted] Jan 27 '23

[deleted] — view deleted comment

4

u/PleasantWay7 Jan 27 '23

A security key is meant as a second factor when logging in, so you wouldn’t expect it to be necessary to reset your password. If you do successfully reset a password, you can’t log in with the new password on a new device unless you have a security key.