Lesson 2 of 13 · 20m
UEFI and Secure Boot, Mechanically
Secure Boot is an Authenticode signature check on PE32+ binaries enforced by four NVRAM variables; its failure modes are revocation gaps, not broken crypto.
What the check actually is
Secure Boot is not a property of the firmware. It is a signature check that runs in the BDS/TSL phases of UEFI, applied to every image loaded through LoadImage — the OS loader, option ROMs, and boot applications. The image is a PE32+ executable. Its signature is Authenticode: a PKCS#7 SignedData blob stored in the PE's security directory (IMAGE_DIRECTORY_ENTRY_SECURITY), covering a hash of the file with the checksum field and the certificate table itself excluded. If the signer chains to a key in db, the image runs. If it matches dbx, or chains to nothing, it does not.
Four NVRAM variables drive the whole thing. PK is the Platform Key — a self-signed certificate naming the platform owner, enrolled by the OEM; possession of the private half is possession of Secure Boot. KEK holds Key Exchange Keys authorized to update the databases. db is the allow list — certificates and image hashes. dbx is the revocation list. On a normal PC, db contains the Microsoft UEFI CA and Windows production signers plus an OEM cert; dbx is Microsoft's revocation list, shipped through Windows Update and, on Linux, through fwupd/LVFS. One subtlety matters operationally: the firmware ships in 'setup mode' with no PK enrolled, and enforcement begins only when the PK is written — bootctl status or mokutil --sb-state distinguishes 'enabled' from 'set up'. A board reporting setup mode runs everything, signed or not — the two variables worth reading on a live system are SecureBoot and SetupMode under efivars, and only SecureBoot=1 with SetupMode=0 means enforcement is actually on.
The Linux chain adds two objects. shim is a ~1 MB PE signed by Microsoft's third-party CA; it embeds the distro's vendor certificate and adds the MOK (Machine Owner Key) list, managed with mokutil and enrolled at reboot through MokManager. Shim verifies GRUB against its embedded cert plus MOK; GRUB verifies the kernel via the shim lockdown protocol; the kernel then restricts itself in lockdown mode — unsigned modules refused, /dev/mem and kexec of unsigned kernels blocked.
The wrong mental model
"Secure Boot makes the boot trusted." It makes one loader signature-checked. It does not verify the DXE drivers inside firmware volumes — those are covered by signed capsules at update time or by Intel Boot Guard at boot time, a different mechanism fused in the chipset. It does not check file contents read as data — which is exactly the gap LogoFAIL exploited (Binarly, December 2023): DXE drivers parsed attacker-controlled BMP/PNG logo files straight off the ESP, and the parsers crashed into code execution during boot. Secure Boot watched it happen, because nothing in db was violated.
And revocation is the weak seam. BootHole (CVE-2020-10713) was a GRUB2 config parser overflow that ran before the kernel — the fix required revoking every signed GRUB and shim in existence, which is why the industry invented SBAT: a generation tag embedded in the PE's .sbat section, revoked wholesale via a signed sbat_level entry instead of thousands of dbx hashes. BlackLotus (ESET, March 2023 — the first real Secure-Boot-bypassing bootkit) rode CVE-2022-21894, "Baton Drop," using still-signed vulnerable Windows boot loaders; the vulnerable binaries stayed valid for months because revoking them broke deployed systems. The crypto never failed. The revocation did. That is the generalizable lesson: Secure Boot's real-world failures are logistics — how fast a revoked binary stops being trusted — rather than algorithm breaks.
What to actually do
Keep dbx current — fwupdmgr refresh && fwupdmgr update or Windows Update; a stale dbx is a standing invitation to every revoked-but-signed bootloader. Verify state with mokutil --sb-state or bootctl status. Never disable Secure Boot to load an unsigned module: sign it and enroll the key into MOK instead, or on systemd distros use sbctl to own the whole key hierarchy locally. Check efi-readvar -v pk — if the PK is a test key, you are one leaked private key away from an attacker-owned boot chain (that is PKfail, lesson of its own). Secure Boot is revocation hygiene, not a switch.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Januscape: A 16-Year-Old Linux KVM Escape Bug
CVE-2026-53359 lets a guest VM crash or potentially root your Proxmox host, and it hid in KVM's shared code for 16 years. What to patch and how to check.
The CPU-ocalypse Is Here, and the AI Industry Walked Right Into It
For three years the AI industry watched GPUs. Nobody was watching the CPU. Now Intel is warning of six-month lead times, AMD has blown past expectations, and the chip everyone assumed would always be available has become the new bottleneck in the biggest infrastructure buildout since the internet.
The RAMpocalypse! How AI Companies Are Destroying the Hosting Industry and Your Wallet
How AI infrastructure demand is driving up VPS and dedicated server costs — and why your hosting bill is going up even though you haven't changed anything.
Getting Started with Embedded C
The Goal By the end of this tutorial, you will be able to compile a binary written for the avr instruction set targeting the AtMega328P microcontroller on an Arduino Nano or Arduino Uno R3 form factor. Needed Documentation * Arduino Nano PCB design * Atmega328P datasheet Materials used * Arduino Nano * Arduino Uno R3 * Relevant cable * Computer Software Used * make (for easy of compiling and building) * avr-gcc (our compiler for avr ISA) * binutils-avr * avr-libc * avrdude (