Back to Blog
APPSEC

Embedded Systems Security: A Developer's Guide to Building Secure Firmware (2026)

22 min readEmre Sakarya
firmware::verify_signature()

Embedded systems security is the application security discipline that operates under constraints the rest of software security can largely ignore: limited compute, limited memory, limited power, decades-long deployment lifetimes, physical access by adversaries, and a hardware substrate whose own integrity the software has to verify before any other defense matters. What is embedded software? — the firmware and applications running on devices designed for a specific function rather than general computation, from medical implants and industrial controllers to consumer IoT, automotive ECUs, and the network equipment running modern infrastructure. The S in IoT, as the running joke goes, stands for security; the joke endures because in 2026, despite a decade of incidents, regulation, and tooling improvement, most embedded devices still ship with security postures that would be unacceptable in a web application. This guide walks the modern embedded systems security discipline from a developer's perspective — the threat model that distinguishes embedded from web/cloud security, the hardware-level concerns that anchor everything else (secure boot, attestation, hardware root of trust), firmware signing and update mechanisms, communication security for constrained devices, secret storage in embedded hardware, and the regulatory frame (EU Cyber Resilience Act, IEC 62443, FDA cyber device requirements) that has reshaped expectations across the industry.

Why Embedded Security Is Different From Web Security

The vocabulary of embedded systems security, often written interchangeably as embedded system security in the singular form, overlaps with web and cloud security — the same vulnerability classes appear, the same OWASP categories apply, the same compliance frameworks reference similar requirements. The cyber security embedded systems discipline shares the foundational principles of broader application security; what changes are the constraints under which those principles are applied and the threat models that drive defensive priorities. Before walking the differences, a quick orientation on terminology: embedded devices meaning in this guide is computing devices designed for a specific function rather than general computation — industrial controllers, consumer IoT, automotive ECUs, medical implants, networking equipment, the firmware running inside vehicles and household appliances. The vocabulary shifts (embedded device, embedded system, embedded systems, embedded software, IoT device, smart device, connected device) all refer to overlapping subsets of the same technical category, with different industry conventions emphasizing different aspects.

The differences are structural. The first difference is the deployment lifetime: a web application is rewritten or replaced every few years; an embedded device — industrial controller, medical device, networking equipment, automotive component — is in production for ten to thirty years. Security decisions made at design time bind the device for its entire deployment, and there is no equivalent of "redeploy the application" when a fundamental vulnerability surfaces five years in.

The second difference is the threat model's inclusion of physical access. Embedded devices, particularly consumer IoT and field-deployed industrial sensors, are routinely in the hands of adversaries who can probe debug interfaces, dump firmware off flash chips, decap microcontrollers, and exercise side-channel attacks that no remote attacker can. Software-only defenses that work against a remote attacker fail against an attacker holding the device. The pragmatic embedded security mental model assumes physical access is part of the threat model unless the device is in a strictly controlled physical environment.

The third difference is the resource constraint. A device with 64KB of flash, 4KB of RAM, and a tightly bounded power budget cannot run the same defenses a server-class system can. Full TLS stacks, modern cryptographic libraries, and the operating system services that abstract security on richer platforms are often unavailable. Embedded security has to make tradeoffs that web security does not — picking weaker cryptographic primitives because the stronger ones do not fit, accepting reduced protocol options because handling the full set bloats the firmware, deferring some defenses to the cloud back-end because the device cannot perform them in real time.

The fourth difference is the supply-chain complexity. An embedded device is hardware plus firmware plus over-the-air update infrastructure plus a cloud back-end plus the mobile or web applications interacting with it. A vulnerability anywhere in this chain compromises the whole. Web applications have supply-chain concerns (dependencies, build infrastructure) but the surface is narrower; embedded devices have all those concerns plus physical supply-chain integrity (the chip is what it says it is), bootloader integrity (the firmware that runs before the OS), and update channel integrity (a malicious update poisons every deployed device).

The Modern Embedded Attack Surface

The embedded attack surface, walking from hardware up to network, has six layers worth distinguishing. Each layer has its own vulnerability classes and its own defensive disciplines, and a complete embedded security program addresses all six rather than treating the device as a monolith.

Hardware layer. The chip itself, the board, the buses connecting chips, the debug interfaces (JTAG, SWD, UART), and the physical exposures (chip decapping, fault injection, side-channel emission). Attacks at this layer are sophisticated but accessible — JTAG access on a consumer device costs a $30 adapter; chip decapping is in reach of well-funded research labs. Defenses include disabling production debug interfaces, fuse-locking the device so firmware cannot be read off-chip, and hardware features (secure elements, TrustZone, PUFs) that provide cryptographic primitives the rest of the system anchors on.

Boot layer. The bootloader, the boot ROM, and the chain of trust that runs before the operating system or application code starts. Attacks here include bootloader replacement, downgrade attacks (running an older signed firmware that has known vulnerabilities), and the broader class of secure-boot bypasses. Defenses cluster around the hardware root of trust pattern — the chip's immutable boot ROM verifies the first-stage bootloader's signature, which verifies the second-stage bootloader, which verifies the kernel or application image, with each verification anchored back to a key burned into hardware.

Firmware layer. The application or operating system running on the device. Vulnerability classes here mirror traditional application security — memory safety failures (the dominant category in C/C++ embedded firmware), input validation, authentication and authorization, output encoding. The defenses are similar to traditional AppSec but constrained by resource limits. Static analysis catches what it catches, but the lack of address space layout randomization on many embedded platforms makes memory safety issues more directly exploitable than on richer platforms. Missing encryption and insecure storage are particularly common findings in embedded firmware audits.

Communication layer. The protocols the device speaks to the outside world — TLS variants for cloud back-ends, BLE for nearby devices, LoRaWAN or NB-IoT for wide-area sensors, CAN bus for automotive contexts. Each protocol has its own attack surface and its own constrained-device variants. Attacks include man-in-the-middle on weak TLS configurations, replay attacks on protocols without nonce protection, and the broader class of insufficient transport-layer authentication where the device authenticates to the cloud but the cloud does not authenticate back to the device.

Cloud back-end layer. The server-side infrastructure the device communicates with. Often the most-mature security layer in the deployment because cloud security disciplines have been more rigorously applied here than on the device side. The attack patterns are standard web/cloud — broken authentication, broken access control, injection vulnerabilities — but with the embedded-specific twist that an attacker who compromises the cloud back-end gains influence over every deployed device.

Update channel layer. The over-the-air (OTA) or USB-based update mechanism by which firmware is delivered to deployed devices. The single most impactful attack surface on most embedded deployments — a malicious update can compromise every device in the field simultaneously. Defenses cluster around signed updates (the device cryptographically verifies the update before applying it), version-pinning (the device refuses to install firmware older than its current version, preventing downgrade attacks), and atomic update with rollback (a failed update can be backed out without bricking the device).

Secure Boot and the Hardware Root of Trust

Secure boot is the foundation that every other embedded security control depends on. If the bootloader can be replaced, the firmware signature verification can be bypassed by the replaced bootloader. If the application image can be tampered with, the bootloader's signature check is meaningless because nothing prevents loading the tampered image. Every embedded security model that takes itself seriously starts with a chain of trust anchored in hardware — typically a key burned into immutable on-chip storage that the boot ROM uses to verify the first stage of code that runs.

The pattern in modern microcontrollers (ARM TrustZone-equipped Cortex-M variants, Espressif's ESP32 with secure boot v2, NXP's RT series, ST's STM32 with the SBSFU framework, the secure-boot-capable variants of nearly every recent embedded silicon line) is broadly similar. The device's immutable boot ROM holds the public key — or more commonly, a hash of the public key — used to verify the first-stage bootloader. The first-stage bootloader (signed by the manufacturer's private key) loads and verifies the second-stage bootloader or the application image directly. Each step's verification is anchored back to the previous step's already-verified key. The chain terminates at the hardware-immutable root, which an attacker cannot replace without physical chip modification.

The implementation pitfalls cluster around three patterns. First, leaving secure boot disabled in production — many development boards ship with secure boot disabled by default for ease of development, and production firmware is written assuming it will be enabled at manufacturing time. The pattern that fails is forgetting to enable it at manufacturing, leaving production devices with disabled secure boot. The fix is automated provisioning that enforces secure boot enablement and audit-checks the fuses on the production line.

Second, key management practices that compromise the root of trust. The private key used to sign firmware is the keystone of the entire security architecture; its compromise nullifies every device that has trusted it. Hardware security modules (HSMs) for the signing key, strict access control on the signing process, audit logging of every sign operation, and key rotation procedures are all standard in mature embedded programs. Programs that store the signing key on an engineer's laptop "for convenience during development" have a single-point-of-failure that has produced several published industry incidents.

Third, downgrade protection. A device that accepts any signed firmware, regardless of version, can be downgraded to an older signed firmware that has known vulnerabilities. The defense is anti-rollback counters — a monotonic counter (often a fuse or one-time-programmable region) that increments with each accepted firmware version and refuses to install firmware whose version is below the counter. Embedded platforms vary in their support for this; the most-defensible platforms (TrustZone-equipped microcontrollers with eFuses) support it natively, others require manual implementation in the bootloader.

Firmware Signing and Secure Updates

Firmware update mechanisms are the single most impactful attack surface on most embedded deployments because a compromise here scales to every deployed device. The defensive pattern that works in 2026 has five properties: cryptographic signing, version-pinned anti-rollback, atomic update with rollback recovery, secure delivery channel, and post-update attestation.

Cryptographic signing. Every firmware image is signed by the manufacturer's private key (held in an HSM); every device verifies the signature using the embedded public key before applying the update. The signing algorithm should be ECDSA on a modern curve (P-256 or P-384) or RSA with at least 3072-bit keys; SHA-1-based signatures and RSA-1024 are no longer acceptable. The verification happens before the update is committed to flash, not after — a partially-applied update with a signature failure mid-write is the kind of failure mode that bricks devices.

Version-pinned anti-rollback. The device tracks its current firmware version in non-volatile state (ideally a fuse or one-time-programmable region) and refuses to install firmware whose version is below the current value. The pattern catches downgrade attacks where an attacker presents a signed-but-older firmware to recover known-vulnerable code paths.

Atomic update with rollback. The update is applied to a secondary partition while the device runs from the primary partition; only after the new firmware verifies its own integrity on first boot is the partition pointer flipped to make the new firmware the primary. If the new firmware fails to boot, the device rolls back automatically. Modern embedded OTA frameworks (Mender, hawkBit, AWS IoT Device Management OTA) implement this pattern natively; hand-rolled OTA implementations very often do not.

Secure delivery channel. The transport carrying the update from the cloud to the device is authenticated and encrypted — typically TLS with mutual authentication, where the device verifies the server's certificate and the server verifies the device's. Plain HTTP delivery with signature verification on the payload alone is technically defensible but operationally fragile; mutual TLS provides defense-in-depth.

Post-update attestation. The device reports its current firmware version, hash, and configuration to the cloud back-end on a defined cadence. Devices reporting a version other than what the back-end deployed indicate either a failed update or a tampered firmware. The reporting cadence depends on the deployment — hourly for high-security devices, daily for consumer IoT — but the principle is that the back-end maintains ground truth on what every device is running.

Communication Security for Constrained Devices

TLS is the default communication security on richer platforms but presents difficulties on constrained embedded devices. The full TLS 1.3 handshake costs memory and compute that small microcontrollers can manage but not comfortably; the certificate verification step in particular requires cryptographic operations and code paths that strain 64KB-flash devices. The practical patterns in 2026 are these.

For devices with sufficient resources (Cortex-A class, richer Cortex-M with 256KB+ flash and 64KB+ RAM): full TLS 1.3 with mutual authentication is the default. The mbedTLS, wolfSSL, and BearSSL libraries provide TLS stacks in this resource envelope. Certificate pinning — the device hard-codes the expected certificate or public key for the cloud back-end — provides defense-in-depth against compromised certificate authorities. The certificate pinning guide covers the implementation patterns and the bypass classes pinning is meant to defend against.

For more constrained devices (smaller Cortex-M, 8-bit microcontrollers, or low-power radio platforms): TLS variants designed for constrained devices (DTLS for UDP-based protocols, CoAPS for the Constrained Application Protocol, OSCORE for end-to-end security at the application layer). The cryptographic primitives in these stacks are tuned for low-resource environments — pre-shared key modes that avoid certificate verification, smaller cipher suites, session resumption to amortize handshake cost across multiple messages.

For the smallest devices (sensor nodes, RFID-class): the security boundary moves up the stack. The device speaks a low-security local protocol to a gateway; the gateway performs the heavyweight cryptographic operations on the device's behalf when communicating to the cloud back-end. The pattern accepts that the device-to-gateway link is best-effort secured (often relying on the physical proximity required for the radio range) while the gateway-to-cloud link is fully authenticated and encrypted.

Secret Storage in Embedded Devices

Embedded devices need to store secrets — TLS client certificates, API keys, cryptographic keys for signing or encryption — and the storage problem is harder than on richer platforms because the device may be physically in the attacker's hands. The pattern that works depends on the silicon's capability.

Modern embedded silicon increasingly includes a secure element — a hardware-isolated key store that holds cryptographic keys in a region the application processor cannot directly read. The application asks the secure element to sign or decrypt; the secure element performs the operation without exposing the key material. Examples include ARM TrustZone's secure world, NXP's EdgeLock SE050, Microchip's CryptoAuthentication chips, and Espressif's secure storage on ESP32. The pattern is the gold standard for embedded secret storage — even an attacker with full physical access cannot extract the keys without specialized hardware attacks well beyond commodity capability.

For devices without dedicated secure elements, the pattern degrades to encrypted-at-rest storage with the encryption key derived from device-specific hardware properties (a fuse, a hardware ID, a physical unclonable function on supporting silicon). The keys are not theoretically secure against an attacker with chip-level access, but they raise the bar substantially against software-only attacks. Hardcoded secrets in firmware images — the worst pattern, where keys are visible in the firmware binary itself — should never appear in production embedded firmware; the static analysis tooling for embedded firmware (Ghidra, IDA, binwalk) makes hardcoded-secret extraction trivial for any motivated attacker.

The most-defensible secret-storage pattern combines a secure element with provisioning that injects unique keys per device at manufacturing time. Every device has its own device-specific identity certificate, its own derived cryptographic keys, and its own attestation key — compromising one device exposes only that device, not the whole fleet. The pattern requires manufacturing-process discipline (key generation in the HSM, secure injection into each device's secure element, audit logging of every injection) but produces the most robust per-device security available on commercial embedded platforms.

Regulatory Frame — EU CRA, IEC 62443, FDA

Embedded security in 2026 operates under a substantially denser regulatory frame than it did even three years earlier. The frameworks that matter for most embedded developers, and how they overlap.

EU Cyber Resilience Act. The CRA's essential requirements (Annex I) apply to any product with digital elements placed on the EU market — which covers nearly all embedded devices sold to EU customers. The requirements include secure-by-design and secure-by-default product properties, vulnerability handling obligations, and security update commitments for the product's expected lifetime. The CRA is the regulation most likely to drive embedded security investment among consumer and industrial device manufacturers; the EU CRA developer guide covers the requirements in operational detail.

IEC 62443. The IEC 62443 series covers industrial automation and control systems security. The standard defines security levels (SL 1 through SL 4) analogous to ASVS verification levels and applies them to industrial components, systems, and the broader operational environment. Industrial embedded device manufacturers selling to regulated industries (energy, utilities, transportation, certain manufacturing verticals) face IEC 62443 expectations from buyers as effectively a procurement requirement, even where the regulation is not legally mandatory.

FDA cyber device requirements. The FDA's 2023 cybersecurity guidance for medical devices became effectively mandatory for new medical device submissions in 2024, with retroactive expectations for previously-submitted devices. Requirements include a software bill of materials, threat modeling artifacts, vulnerability disclosure programs, and ongoing security update commitments. Medical embedded device manufacturers operate under this frame regardless of the device's specific function.

Sector-specific frameworks. Automotive (UN R155, R156), aviation (DO-326A), rail (TS 50701), energy (NERC CIP for North American utilities), and several other verticals have their own embedded security frameworks. The pattern is convergent — all of these reference similar underlying expectations around secure development, vulnerability handling, and update commitments — but the specific compliance evidence required varies by framework.

The pragmatic approach for an embedded device manufacturer selling into multiple regulated industries is to choose the highest-bar framework the product is subject to (typically EU CRA or FDA for products in those scopes, IEC 62443 SL 2 or higher for industrial products) and run a single security program against that bar. The compliance evidence falls out as a byproduct of the verification work, satisfying multiple frameworks from one verification effort. Programs that maintain separate compliance streams for each framework burn operational time on redundant activities.

Where Embedded Security Fits in ASVS and Secure SDLC

The OWASP ASVS standard is web-application-oriented in its origins, but most of its chapters apply to embedded firmware with minor reinterpretation. V11 Cryptography applies essentially unchanged. V12 Secure Communication applies to the device-to-cloud link with the constrained-device variants discussed above. V13 Configuration covers secure-boot configuration, fuse settings, and update-channel configuration as embedded-specific equivalents of deployment configuration. V14 Data Protection covers secret storage in the embedded context. The ASVS 5.0 developer guide covers the chapter structure that this mapping joins into.

The chapters that need extension rather than reinterpretation are V8 Authorization (embedded devices have device-to-cloud authorization concerns that the web ASVS does not directly address) and the broader supply-chain elements introduced in ASVS 5.0 (embedded supply chain includes hardware provenance in addition to software bill of materials). The pragmatic pattern is to use ASVS as the baseline verification standard and add embedded-specific verification requirements on top, rather than substituting an embedded-specific standard entirely.

For the broader secure development lifecycle — threat modeling, secure design, implementation, verification, deployment, monitoring — the secure SDLC pillar covers the framework that embedded security fits inside. The embedded-specific extensions to the SDLC are: threat modeling that explicitly covers physical access and the hardware attack surface; secure design that includes the hardware root of trust as a foundational decision; verification that exercises firmware update mechanisms and downgrade protection; and post-deployment monitoring that maintains attestation and version inventory for every deployed device.

The discipline is the same; the specific risks are embedded-specific. Programs that treat embedded security as a separate practice from the broader AppSec program tend to underinvest in the shared infrastructure (training, tooling, SBOM management, compliance evidence collection) that benefits both. Programs that treat embedded security as an extension of the main AppSec program with embedded-specific verification activities have the cleanest operational structure.

Embedded systems security: questions developers ask

What is embedded software and how do you keep it secure?

Embedded software is firmware and applications running on devices designed for a specific function rather than general computation — medical implants, industrial controllers, consumer IoT, automotive ECUs, networking equipment. Keeping it secure requires the standard application security disciplines plus embedded-specific concerns: a hardware root of trust anchoring secure boot, signed firmware updates with anti-rollback protection, secure communication adapted to constrained devices, secret storage in hardware secure elements, and a regulatory frame (EU CRA, IEC 62443, FDA) appropriate to the device's deployment context.

What does secure embedded systems mean in practice?

A secure embedded system is one whose security architecture is anchored in hardware (immutable boot ROM, hardware root of trust, secure element for key storage), whose firmware is cryptographically signed and verified at boot, whose update mechanism prevents downgrade attacks and supports atomic rollback, whose communication with the cloud back-end is mutually authenticated, and whose deployment lifecycle includes ongoing vulnerability handling and security update delivery. Programs that miss any of these layers have a security architecture only as strong as the missing layer.

Does the S in IoT really stand for security?

The running joke is that the S in IoT stands for security — there is no S in IoT. The joke endures because most embedded and IoT devices ship with security postures that would be unacceptable in a web application: hardcoded credentials, unsigned firmware updates, plain-text communication, no secure boot, no vulnerability disclosure program. The regulatory frame (EU CRA mandatory from late 2027, FDA cyber device requirements effective from 2024) is shifting this, but the installed base of insecure devices will remain in the field for the next decade.

What is cyber security for embedded systems specifically?

Cyber security for embedded systems extends standard application security with concerns specific to the embedded context — physical attacker in the threat model, resource-constrained defenses, decades-long deployment lifetimes, hardware-anchored chain of trust, and over-the-air update mechanisms as primary attack surface. The vulnerability classes (memory safety, input validation, authentication, authorization) overlap with traditional AppSec; the defensive priorities and the constraints under which defenses are implemented differ substantially.

How do I store secrets safely on an embedded device?

The gold standard is a hardware secure element — a hardware-isolated key store that holds cryptographic keys in a region the application processor cannot directly read. Examples include ARM TrustZone, NXP EdgeLock SE050, Microchip CryptoAuthentication chips, and Espressif's ESP32 secure storage. For devices without dedicated secure elements, the pattern degrades to encrypted-at-rest storage with the key derived from device-specific hardware properties. Hardcoded secrets in the firmware binary should never appear in production — static analysis tooling makes them trivially extractable.

What regulations apply to embedded device security?

The major frameworks: EU Cyber Resilience Act (broad coverage of products with digital elements sold to EU customers; secure-by-design, vulnerability handling, security updates throughout product lifetime), IEC 62443 (industrial automation and control systems; security levels SL 1-4), FDA cybersecurity guidance for medical devices (SBOM, threat modeling, vulnerability disclosure, ongoing updates), and sector-specific frameworks for automotive (UN R155/R156), aviation (DO-326A), and energy (NERC CIP). Most embedded manufacturers select the highest-bar framework they are subject to and run one security program against it.

Why is secure boot important for embedded devices?

Secure boot is the foundation every other embedded security control depends on. If the bootloader can be replaced, every signature check the bootloader performs becomes meaningless. The pattern is a hardware-anchored chain of trust — the chip's immutable boot ROM verifies the first-stage bootloader, which verifies the next stage, all anchored to a key burned into hardware that an attacker cannot replace without physical chip modification. Without secure boot, an attacker with brief physical access can replace the firmware and own the device permanently.