[personal profile] mjg59
I gave a presentation at 32C3 this week. One of the things I said was "If any of you are doing seriously confidential work on Apple laptops, stop. For the love of god, please stop." I didn't really have time to go into the details of that at the time, but right now I'm sitting on a plane with a ridiculous sinus headache and the pseudoephedrine hasn't kicked in yet so here we go.

The basic premise of my presentation was that it's very difficult to determine whether your system is in a trustworthy state before you start typing your secrets (such as your disk decryption passphrase) into it. If it's easy for an attacker to modify your system such that it's not trustworthy at the point where you type in a password, it's easy for an attacker to obtain your password. So, if you actually care about your disk encryption being resistant to anybody who can get temporary physical possession of your laptop, you care about it being difficult for someone to compromise your early boot process without you noticing.

There's two approaches to this. The first is UEFI Secure Boot. If you cryptographically verify each component of the boot process, it's not possible for a user to compromise the boot process. The second is a measured boot. If you measure each component of the boot process into the TPM, and if you use these measurements to control access to a secret that allows the laptop to prove that it's trustworthy (such as Joanna Rutkowska's Anti Evil Maid or my variant on the theme), an attacker can compromise the boot process but you'll know that they've done so before you start typing.

So, how do current operating systems stack up here?

Windows: Supports UEFI Secure Boot in a meaningful way. Supports measured boot, but provides no mechanism for the system to attest that it hasn't been compromised. Good, but not perfect.

Linux: Supports UEFI Secure Boot[1], but doesn't verify signatures on the initrd[2]. This means that attacks such as Evil Abigail are still possible. Measured boot isn't in a good state, but it's possible to incorporate with a bunch of manual work. Vulnerable out of the box, but can be configured to be better than Windows.

Apple: Ha. Snare talked about attacking the Apple boot process in 2012 - basically everything he described then is still possible. Apple recently hired the people behind Legbacore, so there's hope - but right now all shipping Apple hardware has no firmware support for UEFI Secure Boot and no TPM. This makes it impossible to provide any kind of boot attestation, and there's no real way you can verify that your system hasn't been compromised.

Now, to be fair, there's attacks that even Windows and properly configured Linux will still be vulnerable to. Firmware defects that permit modification of System Management Mode code can still be used to circumvent these protections, and the Management Engine is in a position to just do whatever it wants and fuck all of you. But that's really not an excuse to just ignore everything else. Improving the current state of boot security makes it more difficult for adversaries to compromise a system, and if we ever do get to the point of systems which aren't running any hidden proprietary code we'll still need this functionality. It's worth doing, and it's worth doing now.

[1] Well, except Ubuntu's signed bootloader will happily boot unsigned kernels which kind of defeats the entire point of the exercise
[2] Initrds are built on the local machine, so we can't just ship signed images
From: [personal profile] glyf
OS X, Linux, and Windows all have the ability for a privileged user to introduce arbitrary steps into the boot process once the operating system has loaded - launchd plists, systemd units, services. So anybody with write access to your root disk or firmware can do arbitrary evil on a fully boot-verified system, regardless of whether they write to EFI or not.

The security model on Apple hardware seems to be "put an EFI password on your system if you are doing anything seriously confidential on it". Evil maids are thus defended against because the OS has locked the ability to write arbitrary files to the filesystem or firmware, which are roughly equivalent as far as I can tell. Cold booting the system doesn't give you the ability to write arbitrary files to the firmware or boot volume, because the EFI password prevents you from changing the boot volume and the FDE password prevents you from changing the boot volume. So where's the attack that Apple hardware enables and others don't? I don't get it.
From: (Anonymous)
Matthew,

As a result of your posts, I've thought a lot more about secure booting. Great talks on youtube. Thanks.

Like many others, I'm surprised you call out Apple computers for being an untrustworthy platform. Since I use on an apple laptop, I did some research and found that newer macs EFI password can't be reset by changing ram or resetting PVRAM [1]. Is there some other way of getting around the EFI password, that I don't know about?

-Chad

[1] https://www.cnet.com/news/efi-firmware-protection-locks-down-newer-macs/
damerell: (computers)
From: [personal profile] damerell
My understanding may be limited, but I think the attacker can't do that (put something nasty into /etc/inittab or whatever) because I supply a passphrase for my encrypted filesystem at boot time. Hence, they have to nobble a bit of the system that's before that and capture the passphrase when I type it.

Profile

Matthew Garrett

About Matthew

Power management, mobile and firmware developer on Linux. Security developer at Aurora. Ex-biologist. [personal profile] mjg59 on Twitter. Content here should not be interpreted as the opinion of my employer. Also on Mastodon.

Expand Cut Tags

No cut tags