Skip to content
Access control Write-up Advanced

Unlocking the Motorola Bootloader with a TrustZone Exploit

The Motorola Android bootloader decides whether the device is unlocked by reading a single bit in a one-time-programmable hardware fuse, and it asks the TrustZone kernel to read and write that fuse through a supervisor call. An attacker who already has code execution in the TrustZone kernel could clear the fuse protections and blow the relevant bit, making the bootloader treat the device as unlocked and allowing an unsigned operating system to load.

bits-please.blogspot.com

Published on bits-please.blogspot.com

In this blog post, we'll explore the Motorola bootloader on recent Qualcomm Snapdragon devices. Our goal will be to unlock the bootloader of a Moto X (2nd Gen), by using the TrustZone kernel code execution vulnerability from the previous blog posts.

The author, on bits-please.blogspot.com

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

Impact

An attacker who already has TrustZone kernel code execution could permanently unlock the bootloader and load an unsigned operating system, though a mistake while blowing a fuse can brick the device.

What the attacker needed

Prior TrustZone kernel code execution; physical device with the target SoC; factory firmware image for analysis

How it was found

  1. Download the factory firmware image and unpack the proprietary motoboot.img container to extract the aboot image.
  2. Search aboot for the unlock-related strings to locate the function that handles unlocking.
  3. Follow that function to the supervisor call with command code 0x3F801 and identify the two command codes it uses.
  4. Locate the matching TrustZone system call and confirm it reads and writes a QFuse at a chosen address.
  5. Use the TrustZone exploit to clear the write-protection flag and widen the allowed fuse range.
  6. Write the least significant bit of the target QFuse so the bootloader reports the device as unlocked.

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.

A bootloader is the small program that starts the phone's operating system, and it checks a lock flag before loading anything unsigned. That flag is stored in a fuse, a tiny piece of hardware memory that can be written once and never reset. The author first breaks into a more privileged part of the chip called TrustZone, then uses that access to write the fuse bit that marks the phone as unlocked.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.