Skip to content

Introduction to Fault Injection (Joe Rozner)

Joe Rozner

HardwareLayerOne 202540 minOpen on YouTube ↗

Analysts investigate attack surfaces and defenses concerning Introduction to Fault Injection (Joe Rozner).

Summary

# Overview In this talk, Joe Rozner introduces the fundamentals of fault injection (hardware glitching) against microcontrollers. Fault injection involves intentionally driving a silicon chip outside its specified operating conditions (such as voltage, temperature, or clock margins) just enough to alter its behavior without crashing it completely. From a security standpoint, the primary motivations are recovering firmware, extracting cryptographic keys or secrets stored in one-time programmable (OTP) memory, and bypassing hardware-enforced security controls to achieve arbitrary code execution.

# Key Topics Rozner breaks down the core hardware security controls targeted by fault injection: - Secure Boot: Uses cryptographic signatures verified by a root of trust (typically etched into mask ROM) to ensure only trusted code executes. - Code Readout Protection & Flash Encryption: Mechanisms that prevent firmware theft. Internal flash typically relies on readout protection flags, while external flash uses encryption (either via a memory management unit or bootloader decryption into RAM). - Debug Interfaces: Protocols like JTAG or SWD that allow direct reading/writing of memory and registers, which are typically disabled in production. - Boot ROM Targeting: Rather than targeting application code—which is complex, large, and timing-inconsistent—attackers focus on the early bootloader stages (e.g., stage 0/1 mask ROM). Boot ROMs are small, etch-fixed in silicon across all identical chips, and control critical security logic during the processor's fetch-decode-execute loop.

# Technical Details To successfully inject a fault, attackers perform characterization to determine precise timing windows, typically down to the nanosecond level: - Characterization Techniques: Attackers measure execution time by toggling GPIO pins on non-locked development boards or monitoring power consumption traces using a shunt resistor and Ohm's law to observe loops and power dips. - Triggering: Glitches are triggered based on high-speed events like reset pin transitions, falling/rising edges, or protocol events (UART, USB) using digital signal decoding or sum of all differences (SAD). - Fault Injection Methods: - Voltage Glitching (Crowbar): The most common method. A fast-switching MOSFET temporarily shorts a power rail (core voltage, IO, or regulator lines) to ground, causing signals or instructions to latch incorrectly (e.g., flipping ones to zeros or skipping branch instructions). This usually requires removing board bypass capacitors. - Clock Glitching: Involves injecting extra clock edges into external clock lines, causing instructions to execute before signals fully propagate across the chip bus. This is less common today due to internal oscillators and clock dividers. - Electromagnetic Fault Injection (EMFI): Uses a high-voltage pulse dumped through a magnetic coil placed over the chip package. EMFI avoids modifying the PCB or removing bypass capacitors, though it often requires spatial X/Y/Z positioning (sometimes automated using repurposed 3D printers like the Ender 3).

# Takeaways Fault injection combines nanosecond-level physical precision with probabilistic brute-force sweeps across target timeframes. Rozner concludes by emphasizing that low-cost hardware and open learning resources have made the field highly accessible. Relevant tools and learning materials mentioned include the ChipWhisperer series (Husky, Nano), the RP2040-based Faultier, training from Thomas Roth (Stack Smashing) on Hex.io, courses by Cristofaro Mune and Niek Timmers (covering ESP32 research), and books such as *The Hardware Hacking Handbook* (Colin O'Flynn, Jasper van Woudenberg) and *Microcontroller Exploits* (Travis Goodspeed).

Related talks