9

We know that UEFI measures the OS bootloader image integrity every time we power on our computer if secure boot is enabled.

With the growing attacks and discoveries of UEFI vulnerabilities, the following questions arise:

I want to know if there's a specification on UEFI that measures the integrity of the UEFI firmware before the Secure Boot process, so It can prevent or avoid flashing attacks to alter the firmware.

Also, I want to know if the integrity of the firmware of the rest of the devices attached to the computer is measured.

My concern here is that if your firmware gets compromised (flashing exploit), the installed malware is able to perform any tasks, thus tricking the early secure-boot protocol.

schroeder
  • 123,438
  • 55
  • 284
  • 319
kub0x
  • 365
  • 1
  • 9
  • To secure against firmware compromise, the processor has to be able to verify the firmware image both on-rom and in memory against a known good value or cryptographic signature. This will be expensive to implement, error-prone and difficult to maintain. I haven't found anything like this in Intel's secure boot and they probably won't add it for consumer grade hardware. – billc.cn Jul 06 '16 at 16:54
  • @bill.cn: the cryptographic verification should be handled in the bootstrapping process? Is there something like a non-flasheable option in current UEFI supported devices? Does a risk exist in terms of compromising the firmware in a hypotetical non-flasheable UEFI? In your opinion, which will be the best method for getting your UEFI firmware not compromised? Thanks for your reply. – kub0x Jul 06 '16 at 18:08
  • I have found a paper that addresses most of my questions: http://blog.invisiblethings.org/papers/2015/x86_harmful.pdf . But I would be glad to read your opinions. – kub0x Jul 06 '16 at 19:10
  • You could use tools like `RWEverything`, `UEFIExtract` from GitHub and etc – Sir Muffington Oct 28 '21 at 14:02

2 Answers2

2

In most cases the UEFI sits in a non-volatile memory (e.g. Nand memory embedded into the mother-board) , a good approach for such protection against FW compromise may be :

BEFORE first writing of the UEFI FW:

1.calculate RSA singature - has to be a strong implementation of RSA (e.g. 4096 modulus length + OAEP padding scheme)

2.Store both public key and signature concatenated to the FW image

3.if there is an option to use OTP memory block(considerably low-cost HW) - provision SHA-512 of the public key to OTP(optional)

On each loading of FW:

1.Verify SHA-512 of the public key concatenated to the FW image(optional)

2.Authenticate RSA signature

3.proceed with boot

This approach is fairly secured and not very expensive since RSA signature authentication will not consume much time (public exponent has few bits in it and thus the exponentiation will be fast enough). I didn't find any such scheme in the secured boot specification , I hope that they will add something of that kind in the future.

Dima Shifrin
  • 129
  • 7
2

Intel Security research team recently released a tool dedicated to this kind of UEFI sanity checking: CHIPSEC UEFI integrity scanner

chipsec / github

You will need a secure reference whitelist to detect your EFI has been compromised.

dan
  • 3,033
  • 14
  • 34