-
Notifications
You must be signed in to change notification settings - Fork 20
EXTRA_SIGN in combination w/ e.g. sd-boot can lead to an attacker being able to sign a malicious file #36
Comments
Hi, Thanks for the report. This is already described in the The second attack is also described in the same section. The overall recommendation is not to use a boot loader at all, but use direct booting. Then the only files on ESP are signed UEFI images. |
This is definitely the way to go, thanks for pointing that out. I suspect we're more than two to have fell for that:
Let me know what you think and if I can help. |
Sorry for not replying for such a long time. While the issue is described correctly in the README, I think it's rather hidden, or rather, the implications aren't that clear. To quote
This sounds like 'an optional tweak' to enhance security -- but without this change, most setups are simply insecure and secure boot does nothing but add 'fake' security.
Unfortunately, as @gilbsgilbs pointed out, the default configuration is insecure for many setups.
Again, 'increased security' sounds like indirect booting (with the default configuration) is secure already, and this just adds "another layer" of security. However, the combination of systemd-boot & sbupdate is, as of now, pretty much impossible to done securely. I think adding an
Of course, if the |
I was just made aware that
EXTRA_SIGN
allows for the following attack scenario, with the example given in the README:Suppose you boot via
systemd-bootx64.efi
.BOOTX64.EFI
as well assystemd-bootx64.efi
. Suppose they maliciously modify the former file (i.e., the one you dont boot from).BOOTX64.EFI
tosystemd-bootx64.efi
and has now control over the bootloader.I think there are two solutions which, at best, could be combined:
/usr/lib/systemd/boot/efi/systemd-bootx64.efi
).The second adjustment is easily made, but the former guards against further, similar attacks:
If the unsigned kernel files are stored on the ESP as well, say you adhere to XBOOTLDR 1 and have the ESP mounted in /boot, s.t. (by default) ArchLinux initramfs/vmlinuz will be put into /boot/..., the same attack can be carried out in a modified fashion:
sbupdate
signs the malicious kernel A-fallback*.Since sbupdate by default is only run on updates, thus overwriting A-fallback* with A-fallback', this will only work if the user triggers it manually. However, if the user has actually multiple kernels installed, say
linux
andlinux-lts
, then this attack is even more likely since:sbupdate
hook and the malicious kernel B* is signed.Now the attacker could use the sd-boot menu to boot the kernel B*
The text was updated successfully, but these errors were encountered: