Fault Injection
Hardware Hacking · Embedded Systems & Firmware track
7 min read
In this module
Breaking Physics to Break Security
Fault injection attacks exploit the physical nature of digital circuits. Disrupt a chip's operating conditions — voltage, clock, electromagnetic environment — and you can coax the CPU into skipping instructions, latching wrong values, or taking the wrong branch. When the skipped instruction happens to be a security check, the protection evaporates.
Voltage Glitching
Digital circuits need stable voltage to behave. Drop the supply briefly while an instruction is executing, and the CPU may skip it or hand back nonsense.
The setup: A voltage glitching rig includes a target device, a glitch controller (like a ChipWhisperer or custom FPGA board), and a trigger mechanism. The controller monitors the target's operation and injects a precisely timed voltage glitch:
- Trigger: Identify the moment the security check executes (using power analysis, timing analysis, or GPIO observation)
- Glitch: Drop the supply voltage briefly at the trigger moment. Depth and width depend heavily on the chip, board and decoupling; tens to hundreds of nanoseconds and a sizeable fraction of a volt is a common starting point for the search
- Observe: Check whether the security check was bypassed
Normal execution: verify_signature(firmware) → FAIL → halt boot
With voltage glitch at verify_signature: verify_signature(firmware) → [glitch causes skip/wrong result] → PASS → boot continuesTargeting secure boot: The classic prize is secure-boot signature verification. The bootloader checks the firmware's digital signature before handing off control. A well-timed voltage glitch during that comparison can cause the CPU to read a failed comparison as a pass, and unsigned firmware boots.
A voltage glitch has three parameters: timing (when during execution), width (how long the glitch lasts), and depth (how much the voltage drops). Finding the right combination requires systematic searching through the parameter space. Tools like ChipWhisperer automate this search by trying thousands of parameter combinations and observing the device's response to each.
This isn't only a lab curiosity. In 2019 researchers glitched the ESP32 past its secure boot digest check (CVE-2019-15894), and the 2011 Xbox 360 "reset glitch hack" pulsed the CPU's reset line at the moment it compared a hash, letting unsigned code boot on hardware Microsoft couldn't patch.
Clock Glitching
Clock glitching messes with the CPU's clock signal instead of its power supply. Inject an extra clock edge or stretch a clock period, and you induce timing violations inside the CPU.
Digital circuits have setup and hold requirements — data must be stable for a minimum time before and after each clock edge. Violate those, and the CPU latches garbage, producing effects close to voltage glitching.
The catch: you need access to the clock signal, which is often harder than tapping the power rail. The payoff is precision — you're controlling instruction timing directly.
Electromagnetic Fault Injection (EMFI)
EMFI parks a small coil near the target chip and fires a localised electromagnetic pulse. The pulse induces currents in the chip's internal wires, producing the same family of faults as voltage glitching — but without ever touching the power supply.
Advantages of EMFI:
- No physical modification: The coil is held near the chip surface, no soldering required
- Spatial selectivity: The coil can target specific areas of the chip
- Bypass voltage monitoring: Simple brown-out detectors watch the supply pin and may not notice a localised EM pulse; dedicated glitch sensors on secure chips are designed to catch it
- Works through enclosures: EM pulses can penetrate thin enclosures
Bypassing Secure Boot
Secure boot is the prize target for fault injection. A successful bypass lets you boot arbitrary firmware, which is total control of the device.
The attack process:
- Identify the boot sequence: Analyse the bootloader's code or behaviour to determine when signature verification occurs
- Set up the trigger: Find an observable signal (like a GPIO toggle, power consumption pattern, or timing delay) that correlates with the verification check
- Sweep glitch parameters: Systematically try different timing, width, and depth values
- Verify success: Check whether the device booted unsigned firmware
A successful glitch can flip the verification function from "fail" to "pass," or simply make the CPU skip the branch that halts boot on failure.
Here's the second outcome on the teaching CPU. The signature check has already failed (R0 is 0), so a normal run ends with R1 = 0xDE, rejected. Step twice to reach the JNZ, press the glitch button, and keep stepping: the branch never runs and the CPU walks straight into the boot path. Then reset and glitch the CMP instead. It doesn't help, because the zero flag was already clear and JNZ still jumps. Timing is everything.
For the best simulation experience, use a desktop browser.
Assembly
Registers
ALU
Memory
| Address | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 10 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 20 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 30 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 40 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 50 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 60 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 70 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 80 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| 90 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| A0 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| B0 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| C0 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| D0 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| E0 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
| F0 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 |
Pipeline
Cycle 0The skip model is a simplification. Real glitches also corrupt a register or a fetched opcode, and those faults can help an attacker too, but "one instruction didn't happen" is all it takes to explain the bypasses in this lesson.
Step 3 is the slow part on real hardware, so here's a toy version in software. The "bootloader" compares an 8-byte signature and then branches to halt; a glitch at a given step with enough width makes that step vanish, and too much width browns the chip out. Sweep the grid and find the window before you look at the code too closely.
On a real target the map is noisy: the same pair works one time in a hundred, and the window drifts with temperature. That's why sweeps run thousands of attempts per point. The double check doesn't make the attack impossible, only harder, since now two glitches have to land in one boot.
Laser Fault Injection
The most surgical fault injection method aims a focused laser at specific transistors on a decapsulated chip — package stripped away to expose the die. The laser's photons generate electron-hole pairs in the silicon, inducing currents that flip bit values. Sub-micron precision; you can pick a register.
Laser fault injection requires:
- Chip decapsulation (removing the package with acid or mechanical means)
- A fault injection laser station (expensive, specialised equipment)
- Detailed knowledge of the chip layout (which transistors to target)
It's the most powerful fault injection approach on offer, and also the one demanding the most kit and expertise. Not a beginner's afternoon project.
Countermeasures
Devices can defend against fault injection:
- Voltage monitoring: Detect supply voltage anomalies and reset
- Clock monitoring: Detect clock frequency anomalies
- Instruction duplication: Execute critical checks twice and compare results
- Error detection codes: Use ECC on critical data to detect corruption
- Active shields: Metal mesh layers that detect decapsulation (for laser attacks)
- Randomized timing: Add random delays around security checks to make timing unpredictable
No single countermeasure stops all fault injection. Voltage monitoring fails against EMFI. Instruction duplication fails against repeated glitches. The most resilient designs use multiple overlapping countermeasures and implement failure modes that default to "deny" - if any anomaly is detected, the device enters a secure state rather than continuing with potentially corrupted execution.