Skip to main content
Be Bitwise

Embedded Security

Embedded Systems & Firmware · Embedded Systems & Firmware track

4 min read

In this module

When the Attacker Has the Device

Embedded security has to grapple with something most servers and desktops never face: physical access. The attacker is holding the device in their hands. They can probe the circuit board, dump the flash, hook up to debug ports. That's a wholly different threat model from a remote attacker rattling at a network service.

Firmware Extraction

The first step in attacking an embedded device is usually extracting its firmware. Attackers can:

  • Read flash memory directly by desoldering the chip and placing it in a programmer
  • Use debug interfaces (JTAG/SWD from the previous lesson) to dump memory contents
  • Intercept firmware updates downloaded over the network
  • Find firmware online in vendor support pages, leaked repositories, or FCC filings

Once extracted, the firmware goes under the reverse engineering tools from Reverse Engineering Basics. Strings, function signatures, and recognisable library code give the firmware its shape and lead you toward the security-relevant bits.

Binwalk

Binwalk is a widely used tool for analysing firmware images. It scans a binary file for embedded file systems, compressed archives, and executable code. A single firmware image might contain a bootloader, a Linux kernel, a root filesystem, and configuration data - all concatenated together. Binwalk identifies these components so each can be extracted and analysed separately.

Secure Boot Chains

Devices defend against firmware tampering with secure boot: a chain of cryptographic checks anchored to a hardware root of trust. The immutable boot ROM checks the vendor's public key, usually against a hash burned into one-time-programmable fuses, then uses it to verify the bootloader's signature before handing off control. The bootloader then verifies the main firmware. If any link in that chain fails its check, the device refuses to boot.

Secure boot is only as strong as its weakest link. A key stored insecurely, a bypass bug in the bootloader, a downgrade attack that loads an older vulnerable firmware — any one of these breaks the whole chain.

Side-Channel Attacks

Conventional software attacks exploit bugs in code. Side-channel attacks exploit the physics of the hardware itself. When a CPU touches secret data, its behaviour leaks in ways you can measure.

Power analysis watches the device's power consumption during cryptographic operations. Different instructions burn different amounts of power, and processing a 1 bit looks subtly different from processing a 0. Collect enough traces and an AES key falls out, typically one byte at a time, since each key byte can be attacked separately.

Timing attacks lean on how long operations take. If a password comparison returns early on the first wrong character, you can guess the password one character at a time just by stopwatching the response.

Electromagnetic analysis sniffs radio emissions with a near-field probe held over the chip. The emissions correlate with instructions executing — same idea as power analysis, no physical contact required.

Physical Access Threats

Embedded devices face attacks that would be impossible on a cloud server:

  • Glitch attacks: momentarily disrupting the power supply or clock signal to cause the CPU to skip an instruction (like a secure boot check)
  • Cold boot attacks: freezing RAM chips to slow data decay, then reading encryption keys after a reboot
  • Debug port access: connecting to JTAG/SWD ports that were left enabled in production

The Trusted Platform Module (TPM)

A TPM is a dedicated security chip (or firmware-based equivalent) that handles cryptographic operations in hardware. It stores keys in tamper-resistant silicon, measures the boot process to spot modifications, and seals secrets to a specific device configuration. TPMs have been common in laptops for years and are creeping into embedded IoT devices as physical security gets harder to ignore.

Defending embedded systems is layered work. Disable debug ports in production. Implement secure boot with key rotation. Use constant-time crypto to resist timing attacks. And assume that any device shipped into the wild will, eventually, be physically compromised.

Where the Course Goes Next

Each attack family in this lesson gets its own deeper treatment later on:

Attack families on an embedded device, and where each is covered

Start with Firmware Acquisition for dumping, Debug Interface Exploitation and Fault Injection for the bench attacks, Building Secure Embedded Systems for side-channel countermeasures, and Secure Boot and Firmware Updates for the boot chain.