Most active commenters

    ←back to thread

    511 points moonsword | 25 comments | | HN request time: 0.691s | source | bottom
    1. thrdbndndn ◴[] No.42168908[source]
    Two questions:

    1. surely unconditionally rebooting locked iPhones every 3 days would cause issues in certain legit use cases?

    2. If I read the article correctly, it reboots to re-enter "Before First Unlock" state for security. Why can't it just go into this state without rebooting?

    Bonus question: my Android phone would ask for my passcode (can't unlock with fingerprint or face) if it thinks it might be left unattended (a few hours without moving etc.), just like after rebooting. Is it different from "Before First Unlock" state? (I understand Android's "Before First Unlock" state could be fundamentally different from iPhone's to begin with).

    replies(7): >>42168981 #>>42169169 #>>42169203 #>>42169266 #>>42169304 #>>42170569 #>>42171458 #
    2. bonyt ◴[] No.42168981[source]
    > 1. surely unconditionally rebooting locked iPhones every 3 days would cause issues in certain legit use cases?

    I wonder if this explains why the older iPhone I keep mounted to my monitor to use as a webcam keeps refusing to be a webcam so often lately and needing me to unlock it with my password...

    replies(1): >>42170032 #
    3. diggan ◴[] No.42169169[source]
    > it reboots to re-enter "Before First Unlock" state for security. Why can't it just go into this state without rebooting?

    I think the reason is to make sure anything from RAM is wiped completely clean. Things like the password should be stored in the Secure Enclave (which encryption keys stored in RAM are derived from) but a reboot would wipe that too + any other sensitive data that might be still in memory.

    As an extra bonus, I suppose iOS does integrity checks on boot too, so could be a way to trigger that also. Seems to me like a reboot is a "better safe than sorry" approach which isn't that bad approach.

    replies(1): >>42170129 #
    4. oneplane ◴[] No.42169203[source]
    It is very different as the cryptography systems can only assure a secure state with a known root of trust path to the state it is in.

    The big issue with most platforms out there (x86, multi-vendor, IBVs etc.) is you can't actually trust what your partners deliver. So the guarantee or delta between what's in your TEE/SGX is a lot messier than when you're apple and you have the SoC, SEP, iBoot stages and kernel all measured and assured to levels only a vertical manufacturer could know.

    Most devices/companies/bundles just assume it kinda sucks and give up (TCG Optal, TPM, BitLocker: looking at you!) and make most actual secure methods optional so the bottom line doesn't get hit.

    That means (for Android phones) your baseband and application processor, boot rom and boot loader might all be from different vendors with different levels of quality and maturity, and for most product lifecycles and brand reputation/trust/confidence, it mostly just needs to not get breached in the first year it's on the market and look somewhat good on the surface for the remaining 1 to 2 years while it's supported.

    Google is of course trying hard to make the ecosystem hardened, secure and maintainable (it has been feasible to get a lot of patches in without having to wait for manufacturers or telcos for extended periods of time), including some standards for FDE and in-AOSP security options, but in almost all retail cases it is ultimately an individual manufacturer of the SoC and of the integrated device to make it actually secure, and most don't since there is not a lot of ROI for them. Even Intel's SGX is somewhat of a clown show... Samsung does try to implement their own for example, I think KNOX is both the brand name for the software side as well as the hardware side, but I don't remember if that was strictly Exynos-only. The supply chain for UEFI Secure Boot has similar problems, especially with the PKI and rather large supply chain attack surface. But even if that wasn't such an issue, we still get "TEST BIOS DO NOT USE" firmware on production mainboards in retail. Security (and cryptography) is hard.

    As for what the difference is in BFU/AFU etc. imagine it like: essentially some cryptographic material is no longer available to the live OS. Instead of hoping it gets cleared from all memory, it is a lot safer to assume it might be messed with by an attacker and drop all keys and reboot the device to a known disabled state. That way, without a user present, the SEP will not decrypt anything (and it would take a SEPROM exploit to start breaking in to the thing - nothing the OS could do about it, nor someone attacking the OS).

    There is a compartmentalisation where some keys and keybags are dropped when locked, hard locked and BFU locked, the main differences between all of them is the amount of stuff that is still operational. It would suck if your phone would stop working as soon as you lock it (no more notifications, background tasks like email, messaging, no more music etc).

    On the other hand, it might fine if everything that was running at the time of the lock-to-lockscreen keeps running, but no new crypto is allowed during the locked period. That means everything keeps working, but if an attacker were to try to access the container of an app that isn't open it wouldn't work, not because of some permissions, but because the keys aren't available and the means to get the keys is cryptographically locked.

    That is where the main difference lies with more modern security, keys (or mostly, KEKs - key encryption keys) are a pretty strong guarantee that someone can only perform some action if they have the keys to do it. There are no permissions to bypass, no logic bugs to exploit, no 'service mode' that bypasses security. The bugs that remain would all be HSM-type bugs, but SEP edition (if that makes sense).

    Apple has some sort of flowchart to see what possible states a device and the cryptographic systems can be in, and how the assurance for those states work. I don't have it bookmarked but IIRC it was presented at Black Hat a year or so ago, and it is published in the platform security guide.

    5. spijdar ◴[] No.42169266[source]
    The short answer to your last two questions is that “before first unlock” is a different state from requiring the PIN/passcode. On boot, the decryption keys for user profile data are not in memory, and aren’t available until they’re accessed from the security coprocessor via user input. The specifics depend on the device, but for Pixel devices running GrapheneOS you can get the gist of it here: https://grapheneos.org/faq#encryption

    The important distinction is that, before you unlock your phone for the first time, there are no processes with access to your data. Afterwards, there are, even if you’re prompted for the full credentials to unlock, so an exploit could still shell the OS and, with privilege escalation, access your data.

    Before first unlock, even a full device compromise does nothing, since all the keys are on the <flavor of security chip> and inaccessible without the PIN.

    replies(1): >>42169444 #
    6. dwaite ◴[] No.42169304[source]
    > Why can't it just go into this state without rebooting?

    Because the state of the phone isn't clean - there is information in RAM, including executing programs that will be sad if the disk volume their open files are stored on goes away.

    If your goal is to get to the same secure state the phone is in when it first starts, why not just soft reboot?

    replies(1): >>42169685 #
    7. ◴[] No.42169444[source]
    8. TimeBearingDown ◴[] No.42169685[source]
    this also clears out deeper OS rootkits if they could not achieve reboot persistence, which is not uncommon.
    9. athrun ◴[] No.42170032[source]
    I have the same setup and what works for me is putting the phone into Supervised mode using the Apple Configurator.

    From there, you can enable single app mode to lock it into the app you're using for the webcam (I use Camo).

    10. gizmo686 ◴[] No.42170129[source]
    Reboots don't typically wipe RAM. Although wiping ram is relatively easy if you are early enough in the boot process (or late enough in the shutdown process).
    replies(3): >>42171294 #>>42171332 #>>42173620 #
    11. Kwpolska ◴[] No.42170569[source]
    What legit use case involves not touching your phone at all for 3 days?
    replies(5): >>42170902 #>>42170909 #>>42171167 #>>42173387 #>>42175323 #
    12. Hackbraten ◴[] No.42170902[source]
    Maybe you want people to be able to reach you on a secondary, inbound-only phone number.

    I’ve also heard people re-purpose old phones (with their batteries disconnected, hopefully) as tiny home servers or informational displays.

    replies(1): >>42195950 #
    13. adastra22 ◴[] No.42170909[source]
    Not a phone, but at my old apartment I used to have an iPad mounted on the wall. It was a dynamic weather display, Ring doorbell answerer, multimedia control, etc. Would suck if every 3 days I had to enter my passcode again.
    replies(3): >>42170942 #>>42172496 #>>42172862 #
    14. Shank ◴[] No.42170942{3}[source]
    I haven’t tested this, but I assume this wouldn’t occur if the device is fully unlocked and powered on. Most kiosk adjacent deployments are setup so that they never turn the screen off and remain unlocked.
    15. ◴[] No.42171167[source]
    16. bayindirh ◴[] No.42171294{3}[source]
    With ASLR and tons of activity happening during the boot process, it's almost guaranteed that you'll damage the keys you need. Plus, we don't know how shutdown processes are done. It might be wiping the keys clean before resetting the processor.
    17. johncolanduoni ◴[] No.42171332{3}[source]
    I'd expect that the RAM encryption key is regenerated each boot, so the RAM should be effectively wiped when the key from the previous boot is deleted from the memory controller.
    18. Someone ◴[] No.42171458[source]
    > If I read the article correctly, it reboots to re-enter "Before First Unlock" state for security. Why can't it just go into this state without rebooting?

    1. Getting there reliably can be hard (see the age-old discussions about zero-downtime OS updates vs rebooting), even more so if you must assume malware may be present on the system (how can you know that all that’s running is what you want to be running if you cannot trust the OS to tell you what processes are running?)

    2. It may be faster to just reboot than to carefully bring back stuff.

    19. grishka ◴[] No.42172496{3}[source]
    Looks like something that doesn't need to have a passcode on it in the first place.
    replies(1): >>42175351 #
    20. myflash13 ◴[] No.42172862{3}[source]
    iPad has a kiosk mode for these use cases.
    21. YoumuChan ◴[] No.42173387[source]
    I connect an iPhone 12 to my vehicle's CarPlay all the time. Recently I often found the start unreliable, which defeats all the purpose.
    22. diggan ◴[] No.42173620{3}[source]
    > Reboots don't typically wipe RAM.

    Typically yeah, I think you're right. But I seem to recall reading that iOS does some special stuff when shutting down/booting related to RAM but of course now I cannot find any source backing this up :/

    23. layer8 ◴[] No.42175323[source]
    It means that in the future you can’t use old iPhone hardware to run an unattended server or similar anymore (unless you simulate user activity by adding some hardware that taps on the display every three minutes, or something). This is why I don’t like that it’s a hardcoded non-configurable setting. It cripples potential use cases for the hardware.
    24. layer8 ◴[] No.42175351{4}[source]
    I have something like this as well, connected to my Apple account for calendar and reminder access etc. I wouldn’t want every random guest to have access to that.
    25. neop1x ◴[] No.42195950{3}[source]
    The article says the phone reception works even BFU (just without contact info)