The current state of boot security
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
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
no subject
(Anonymous) 2016-01-01 05:03 am (UTC)(link)Wrong
(Anonymous) 2016-01-01 08:58 pm (UTC)(link)Re: Wrong
(Anonymous) 2016-02-02 05:19 pm (UTC)(link)Anyway i still did not see any real research demonstrating that ME can bypass IOMMU protection on this 2 chips CPU/PCH architecture. Only speculation and conspiracy theories.
Re: Wrong
(Anonymous) 2016-02-22 11:32 am (UTC)(link)Re: Wrong
(Anonymous) 2017-05-03 03:38 am (UTC)(link)no subject
(Anonymous) 2016-01-01 05:09 am (UTC)(link)no subject
(Anonymous) 2016-01-02 05:29 pm (UTC)(link)no subject
(Anonymous) 2016-01-02 08:06 pm (UTC)(link)no subject
no subject
(Anonymous) 2016-03-01 12:04 am (UTC)(link)no subject
(Anonymous) 2016-01-01 03:15 pm (UTC)(link)Date: 2016-01-01 03:15 pm (UTC)
(Anonymous) 2016-01-07 03:28 am (UTC)(link)Secure nonsense
(Anonymous) 2016-01-01 03:49 pm (UTC)(link)This feature makes $ecure Boot a bad joke.
We need open source firmware and hardware. Until then security is a fairy tale.
Re: Secure nonsense
atomic initrds
(Anonymous) 2016-01-01 09:41 pm (UTC)(link)How to properly configure Linux?
(Anonymous) 2016-01-02 09:21 pm (UTC)(link)I don't understand the threat model around boot security
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.
Re: I don't understand the threat model around boot security
Re: I don't understand the threat model around boot security
(Anonymous) 2016-11-21 06:02 pm (UTC)(link)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/
Re: I don't understand the threat model around boot security
Re: I don't understand the threat model around boot security
Related TPM and UEFI Secure Boot 32C3 presentations
(Anonymous) 2016-01-03 01:54 pm (UTC)(link)"ruedi: Microsofts Windows 10 Botnet": https://www.youtube.com/watch?v=imXZqr5t89g
Also another 32c3 related presentation:
"Joanna Rutkowska: Towards (reasonably) trustworthy x86 laptops": https://www.youtube.com/watch?v=rcwngbUrZNg
Re: Related TPM and UEFI Secure Boot 32C3 presentations
(Anonymous) 2016-01-26 08:40 am (UTC)(link)"Ubuntu's signed bootloader will happily boot unsigned kernels which kind of defeats the entire..."
Re: "Ubuntu's signed bootloader will happily boot unsigned kernels which kind of defeats the entire.
(Anonymous) 2016-01-13 08:02 pm (UTC)(link)"MICROSOFT KILLS LINUX WITH EVIL DRM" -- Slashdot, the post
Re: The current state of boot security
(Anonymous) 2016-01-12 10:37 am (UTC)(link)What I did is similar to what EvilAbigail does but my work is less automated (and more painful but illustrative at the same time :p).
It turns out that is ridiculously easy to mess with initrd and run code to capture LUKS credentials or dropping a shell.
What i do wonder is, what happens if you have grub full disk encryption (including /boot) and SecureBoot enabled? Are you still vulnerable to initrd tampering?
Regards,
Angel Suarez-B. (n0w)
no subject
(Anonymous) 2016-02-05 02:50 pm (UTC)(link)libreboot?
(Anonymous) 2017-05-03 07:05 am (UTC)(link)