Boot Partition Confusion in U-Boot and Linux
Partition identifiers like PARTUUID and PARTLABEL are not enforced to be unique, so an attacker can create a duplicate identifier pointing to a malicious root filesystem. In a two-stage boot process, U-Boot verifies the legitimate partition by name, but Linux mounts the first partition with the same PARTUUID, allowing the attacker's unverified root filesystem to run.
Published on anvilsecure.com
Partition identifiers such as PARTUUID and PARTLABEL are often assumed to be unique, but nothing enforces it. In a two-stage boot process, that assumption can let an attacker get an unverified root filesystem mounted while every integrity check still passes.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The bootloader and the Linux kernel resolve partition identifiers differently, and the identifiers are not guaranteed to be unique, so the verified partition and the mounted partition can differ.
Impact
An attacker could bypass integrity verification and run unsigned code as root, but the attack requires the ability to add a partition with a duplicate identifier, such as by plugging in a USB stick.
What the attacker needed
Ability to add a partition with duplicate ID; physical access to plug in USB or SD card; bootloader uses PARTUUID/PARTLABEL for root
The fix
Use dm-verity to bind the root filesystem integrity to its content and anchor the root hash in a signed FIT image, or load and verify the root filesystem in RAM before booting.
How it was found
- Create a partition table with two partitions having the same PARTUUID: one malicious and one legitimate.
- Ensure the legitimate partition has the expected PARTLABEL so U-Boot verifies it.
- Boot the system; U-Boot verifies the legitimate partition by PARTLABEL and passes its PARTUUID to the kernel.
- Linux resolves the PARTUUID to the first matching partition, which is the malicious one, and mounts it.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When a computer starts, it uses a small program (the bootloader) to load the main operating system. This bootloader often checks that the operating system files are safe and unchanged. But if two different storage areas have the same name or ID, the bootloader might check one while the system later uses the other. An attacker can exploit this to make the system run malicious files even though the security check passed.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.