Exploring New Embedded Bootloader Exploits For Firmware Extraction
Qais Temeiza (Information Security Consultant and Researcher · Victum LTD)
Insomni'hack 2026 · Day 1 · Main Track
Overview
This technical presentation explores novel methods for extracting firmware from embedded microcontrollers by bypassing Code Read Protection (CRP) mechanisms. Delivered by Qais Temeiza, the talk centers on the NXP LPC microcontroller family—specifically the widely used LPC1343, an ARM Cortex-M3 microcontroller—and demonstrates how flaws in both software interfaces and hardware logic can be weaponized to dump protected code. Temeiza details two primary attack vectors: a software vulnerability within the USB mass storage device (MSD) bootloader implementation, and a precise hardware timing attack targeting the flash sector erasure sequence.

Key moments
- 0:00 Introduction and research overview on NXP LPC devices
- 2:00 Code read protection levels and boot process checks
- 4:00 Previous research and glitching attacks on the device
- 6:00 USB mass storage device FAT12 file system emulation
- 10:00 USB firmware deletion vulnerability and assembly analysis
- 13:30 Live demonstration of the USB exploit script
- 17:00 Hardware-based flash erasure and timing attack overview
- 22:00 Recommendations, vendor disclosure, and conclusions
- 24:40 Audience Q&A and closing remarks
Exploring New Embedded Bootloader Exploits For Firmware Extraction
Speakers: Qais Temeiza (Information Security Consultant and Researcher, Victum LTD)
Conference: Insomni'hack
YouTube: https://www.youtube.com/watch?v=s3dvrgfq0NA
Overview
This technical presentation explores novel methods for extracting firmware from embedded microcontrollers by bypassing Code Read Protection (CRP) mechanisms. Delivered by Qais Temeiza, the talk centers on the NXP LPC microcontroller family—specifically the widely used LPC1343, an ARM Cortex-M3 microcontroller—and demonstrates how flaws in both software interfaces and hardware logic can be weaponized to dump protected code. Temeiza details two primary attack vectors: a software vulnerability within the USB mass storage device (MSD) bootloader implementation, and a precise hardware timing attack targeting the flash sector erasure sequence.
The research matters because embedded microcontrollers underpin millions of industrial, automotive, and consumer devices, often serving as the root of trust. While hardware voltage glitching has historically been the go-to method for attacking these targets, Temeiza's findings prove that software-accessible interfaces and microsecond-level power manipulation can achieve the same—or more reliable—results with significantly lower hardware complexity. Ultimately, the work led NXP to discourage the use of these vulnerable microcontrollers and mark the LPC1343 as end-of-life (EOL).
Background
▶ Watch: Introduction and research overview on NXP LPC devices (0:00)
The NXP LPC1343 microcontroller implements several standard peripheral interfaces, including UART, Serial Wire Debug (SWD), and USB, alongside built-in security features known as Code Read Protection. CRP on these devices is traditionally configured into three distinct levels. CRP1 restricts direct memory reading while permitting writes to specific addresses; CRP2 applies more aggressive restrictions; and CRP3 represents the highest security posture, locking down nearly all external access vectors. During boot, the device inspects the CRP configuration at reset to determine whether to disable the debugger interface. Later, if the chip enters In-System Programming (ISP) bootloader mode, additional CRP checks are evaluated.
Prior security research on the LPC family heavily focused on fault injection. Researchers such as Chris Gerlinski successfully glitched the ISP CRP checks, while Walid and Banda targeted the early debug CRP checks during device reset. Additionally, Temeiza and collaborators presented work at Black Hat 2019 that bypassed CRP level 1 via stack-overflow ROP (Return-Oriented Programming) chain attacks within an ISP command. Despite these historical findings, extracting firmware without relying on complex optical or voltage glitching setups remained an active challenge, prompting the search for logic flaws in auxiliary bootloader modes.
Key Findings
▶ Watch: Previous research and glitching attacks on the device (4:00)
Temeiza's research uncovered two distinct pathways for bypassing CRP levels 2 and 3 on LPC devices without requiring complex voltage glitching equipment:
- USB MSD Partial Firmware Overwrite: The LPC bootloader emulates a FAT12 file system in RAM, presenting the device to a host as a mass storage device containing a file named
firmware.dat.bin. The bootloader expects a specific FAT protocol indicator—the0xE5byte—to signal file deletion before wiping and replacing the firmware. However, an oversight in the ROM bootloader's address validation logic allows incoming write packets targeting addresses above2048bytes to bypass the deletion check. This flaw permits an attacker to send a malicious write packet that triggers an isolated sector erase on sector zero (where the CRP configuration byte resides) while leaving the remaining flash sectors intact and readable. - Precision Flash Erasure Interruption: When CRP is enabled, erasing flash requires selecting all sectors simultaneously to prevent partial clearing of sensitive code. The flash controller erases sectors sequentially from sector zero upwards, flipping bytes toward
0xFF. Because sector zero houses the CRP configuration byte, it undergoes modifications earlier in the erase cycle than higher sectors. By triggering an erase command and cutting power after a precise latency window of approximately 300 microseconds, an attacker can flip the CRP configuration byte to disable protection while leaving the user firmware largely intact in the remaining flash sectors.
Technical Deep Dive
▶ Watch: USB firmware deletion vulnerability and assembly analysis (10:00)
The architectural root cause of the USB vulnerability lies in how the ROM bootloader handles block addressing during file operations. The LPC bootloader maps the first four blocks (0 to 3) into RAM for FAT12 metadata emulation, while blocks 4 through 67 correspond to physical flash memory.
At the assembly level, the bootloader evaluates whether a write or delete operation targets the RAM-emulated FAT structures (address <= 2048 bytes). When a file deletion request is processed, it checks for the 0xE5 deletion marker. If the write offset falls outside the protected RAM bounds (i.e., > 2048), the control flow diverges. Instead of enforcing standard CRP validation and wiping the entire user storage space, the code branches directly into the flash writing routine.
Inside this routing flaw, calling the sector erase function on any address within sector zero forces the hardware to erase that specific sector. Because the CRP value resides in sector zero, its destruction nullifies the protection mechanism. When read back via the emulated mass storage interface, the decrypted or exposed firmware can be extracted, bypassing the zeroes normally output when CRP2 is active.
For the hardware timing attack, the microcontroller's internal charge pump and flash cell clearing characteristics dictate the timing window. As the flash controller sweeps through memory during an erase operation, sector zero experiences byte state transitions faster than higher sectors (such as sector seven). By introducing an intermediate microcontroller—such as an Arduino Nano connected via UART—to act as a power-switching intermediary, the target LPC device can be reset, commanded to initiate a mass flash erase, and abruptly depowered precisely 300 microseconds later. This leaves the intermediate memory states frozen, neutralizing the CRP byte without corrupting the application code stored further down the flash map.
Demo / Proof of Concept
▶ Watch: Hardware-based flash erasure and timing attack overview (17:00)
Temeiza demonstrated the USB mass storage exploitation technique live using a Python script interacting with an LPC1343 device configured with CRP level 2.
- Initial State: When connected to a host computer, the device enumerated as a mass storage device. Opening the
firmware.dat.binfile in a hex editor revealed only null bytes (0x00), confirming that CRP2 successfully masked the underlying code. - Exploitation: The operator executed a custom Python script that transmitted a crafted USB write packet targeting a block within sector zero. This packet bypassed the FAT deletion check and forced the ROM bootloader to execute the sector erasure routine on sector zero.
- Verification: Following an automatic device reset, the CRP protection was reported as disabled. Comparing the extracted binary against the original firmware in a file comparison tool showed that while sector zero had been modified (filled with no-op instructions like
0x00BFused as a test harness), sectors one through seven remained completely intact, successfully extracting the proprietary firmware with minimal data loss.
Note: A live demonstration of the hardware-based timing attack was omitted due to a thermal soldering failure on the Arduino test rig, though the physical wiring methodology utilizing an Arduino Nano and UART level-shifting was detailed.
Defensive Implications
▶ Watch: Audience Q&A and closing remarks (24:40)
Defenders and embedded system architects must recognize that relying on a single, isolated security bit or configuration register in flash memory creates a single point of failure. If an attacker can manipulate, overwrite, or prematurely interrupt the erase cycle of that specific memory address, the entire security perimeter collapses.
To mitigate these classes of vulnerabilities, silicon vendors and device developers should adopt several hardening practices:
- Hardware-Enforced Fuses: Transition away from rewritable flash-based CRP configurations toward one-time programmable (OTP) hardware fuses or dedicated secure elements that cannot be manipulated via software bootloader logic flaws.
- Strict Boundary Validation: Ensure that bootloader parsers enforce rigorous bounds checking and state machine validation across all available communication interfaces (USB, UART, SPI), preventing unauthorized transition paths from file system emulation routines directly into raw flash modification routines.
- Disable Unused Boot Interfaces: In production environments where USB mass storage or ISP bootloaders are unnecessary, permanently disable these interfaces via configuration fuses to eliminate the attack surface entirely.
- Defense-in-Depth Cryptography: Implement encrypted bootloaders and firmware images decrypted at runtime by on-chip hardware accelerators, ensuring that even if raw flash contents are extracted, the binary remains unreadable without proprietary cryptographic keys.
Key Takeaways
- NXP LPC1343 microcontrollers are susceptible to firmware extraction via logic flaws in the FAT12 RAM emulation layer of the USB mass storage bootloader.
- A logic bypass in address validation allows attackers to trigger localized sector erasures on sector zero without erasing the entire device or satisfying standard CRP checks.
- Hardware timing attacks utilizing an external microcontroller (such as an Arduino Nano) can reliably disable CRP by cutting power approximately 300 microseconds into the flash erase sequence.
- Responsible disclosure prompted NXP to discourage the use of vulnerable LPC devices and mark the LPC1343 family as end-of-life.
- Embedded device security cannot rely on a single, mutable configuration value in flash memory to protect proprietary code.
About the Speaker(s)
- Qais Temeiza (Information Security Consultant and Researcher, Victum LTD): Qais holds an MSc from the University of Birmingham and has conducted low-level security research on embedded devices for several years, publishing research in top journals and conferences. He leads embedded research activities at Victum LTD and has worked on securing mobile financial apps against low-level attacks.