Secure OTA firmware updates: a practical guide for IoT

Hephaestus Technology7 min read

Secure OTA firmware updates mean every update your device installs over the air is signed by you, verified by the device before it runs, protected against rollback to older vulnerable versions, and recoverable if installation fails. That combination is what RFC 9019, the IETF's firmware update architecture for IoT, and the ETSI EN 303 645 consumer IoT standard describe. It is also what the EU's Cyber Resilience Act expects when it requires manufacturers to "securely distribute updates" for their products.

Key takeaways

  • Sign every firmware image and have the device verify the signature against a key it trusts before installing.
  • Use secure boot so the device only runs authentic firmware, and a version counter so it refuses older images.
  • Keep a fallback image (A/B slots or a recovery partition) so a failed update cannot brick the device.
  • Protect signing keys offline or in an HSM; a leaked key turns your update channel into an attack channel.
  • The CRA requires secure update distribution, automatic security updates where applicable, and free security updates for the support period.

Why does secure OTA matter so much?

Because the update channel is both your best defence and your biggest single point of failure. Without updates, every vulnerability you ship stays there for the life of the product. With an insecure update channel, an attacker who can push firmware owns your whole fleet.

The regulatory direction is clear. The CRA's Annex I Part I requires products to "ensure that vulnerabilities can be addressed through security updates", including automatic security updates enabled by default where applicable, with a clear opt-out. Annex I Part II requires mechanisms "to securely distribute updates" and says security updates must be "disseminated without delay" and, in general, free of charge. These apply to products placed on the market from 11 December 2027, for a support period that Article 13(8) says shall be at least five years unless the product's expected use is shorter.

What does a secure update chain look like?

It has five links, and an attacker only needs one weak one.

Link What it does Reference
Build and sign You produce the image and sign it with a private key kept offline RFC 9019
Manifest Metadata describing the image: version, target hardware, digest, dependencies RFC 9019
Transport Delivers manifest and image to the device, over TLS where possible ETSI 5.5
Verify and install Device checks signature, version and hardware match before writing ETSI 5.3-10
Secure boot and recovery Device only boots authentic firmware, and can fall back if the new image fails ETSI 5.7-1, NIST SP 800-193

RFC 9019 stresses that security should protect the image and manifest end to end, not just the transport, so that updates stay safe when delivered through CDNs, gateways or broadcast.

How do you build it, step by step?

1. Set up a signing key hierarchy. Generate a firmware signing key pair and keep the private key offline or in a hardware security module, never on a build server developers can log into. Consider a root key that signs short-lived signing keys, so you can rotate them without changing what the device trusts.

2. Provision the public key into the device at manufacture. Store it in read-only memory, one-time-programmable fuses or a secure element. ETSI provision 5.4-4 says critical security parameters used for update integrity and authenticity checks shall be unique per device and produced in a way that reduces the risk of automated attacks against whole classes of devices, and provision 5.4-3 forbids hard-coded critical security parameters in device software.

3. Enable secure boot. ETSI provision 5.7-1 says devices should verify their software using secure boot, with a hardware root of trust as one way to do it. Most modern microcontrollers and SoCs offer this; turn it on before production, because it is hard to retrofit.

4. Sign a manifest, not just the binary. Include version, hardware model, image digest and any dependencies. RFC 9019 notes that a manifest specification must support different cryptographic algorithms, so plan for algorithm changes over a five-year support period.

5. Verify before you write. ETSI provision 5.3-10 says that where updates are delivered over a network interface, the device "shall verify the authenticity and integrity of each update via a trust relationship". Reject images for the wrong hardware, with a bad signature or with a bad digest.

6. Block rollback. Keep a monotonic version counter in protected storage and refuse anything older. RFC 9019 is explicit: a device "must not be tricked into installing" an old but valid firmware.

7. Design for failure. Store two images (A/B slots) or a recovery image. Install to the inactive slot, boot it in trial mode, and only mark it good after a health check. RFC 9019 says devices "must not fail when a disruption, such as a power failure" occurs during an update. NIST SP 800-193 frames the same idea as protection, detection and recovery.

8. Make it automatic and visible. ETSI provisions 5.3-4 to 5.3-6 recommend automatic updates, periodic checks for new versions, and user controls to enable, disable or postpone them. Notify users when an update will interrupt the device (5.3-12).

9. Roll out in stages. Push to a small percentage of the fleet, watch error rates and connectivity, then widen. Keep a kill switch to pause a rollout.

10. Plan for constrained links. On low-bandwidth networks such as NB-IoT or LoRaWAN, full images may be impractical; delta updates help, but add dependency handling that RFC 9019 covers. Our IoT connectivity comparison explains the bandwidth trade-offs.

What checklist can you follow today?

  • [ ] Private signing key stored offline or in an HSM, with documented access
  • [ ] Public key provisioned in immutable storage at manufacture
  • [ ] Secure boot enabled on production hardware
  • [ ] Signed manifest with version, hardware ID and digest
  • [ ] Device verifies signature and digest before writing
  • [ ] Anti-rollback version counter in protected storage
  • [ ] A/B or recovery image with automatic fallback
  • [ ] Update delivered over an authenticated, encrypted channel
  • [ ] Automatic updates on by default, with user postpone and opt-out
  • [ ] Staged rollout with monitoring and pause
  • [ ] SBOM generated for each release
  • [ ] Support period defined and published

How does secure OTA connect to the rest of product security?

Updates are the delivery end of vulnerability handling. You need to know what is in each image, which is why each release should have a software bill of materials. You need a way to hear about bugs, which is the job of a disclosure policy. And you need to tell users how long you will keep shipping fixes: ETSI provision 5.3-13 requires the support period to be published, as does the CRA. The full set is in our Cyber Resilience Act checklist.

For wireless devices sold in the EU today, the Radio Equipment Directive's cybersecurity requirements also apply. Note that when the Commission cited the EN 18031 standards, it excluded the secure-update assessment criteria in EN 18031-3 for equipment handling financial assets, so products in that category need their own justification.

What are the common mistakes?

  • Signing key on the CI server. Anyone who compromises the build system can sign malware.
  • Checking the signature after writing to flash. A failed check then leaves a half-written image.
  • No rollback protection. Attackers simply reinstall the old vulnerable version you signed last year.
  • One image slot. A power cut mid-update becomes a support ticket or a truck roll.
  • Debug interfaces left open. JTAG or UART access can bypass the whole chain.
  • No update path for the bootloader or radio firmware. RFC 9019 and ETSI acknowledge not everything can be updated; document what cannot, and why.

Frequently asked questions

What makes an OTA firmware update secure?

The device verifies a cryptographic signature from the manufacturer before installing, checks the update is meant for its hardware and is newer than the current version, and can recover if installation fails. Secure boot then ensures only authentic firmware runs.

Does the Cyber Resilience Act require automatic updates?

Where applicable, yes. Annex I requires automatic security updates enabled by default, with a clear way for users to opt out and to postpone them. Products mainly intended to be integrated as components into other products are treated differently.

Should firmware images be encrypted as well as signed?

Signing is essential; encryption is optional. RFC 9019 treats confidentiality of firmware as optional, useful mainly to protect intellectual property or make reverse engineering harder. Integrity and authenticity are what stop malicious updates.

What is A/B partitioning?

It means storing two firmware slots on the device. The update is written to the inactive slot and booted on trial; if it fails a health check, the device falls back to the previous slot, so a failed update does not brick it.

How long must I keep shipping firmware updates?

Under the CRA, for the support period, which must be at least five years unless the product is expected to be in use for less time. Security updates should be provided free of charge in general and without delay.

Building a connected product and want a second opinion on its security plan? Book a free 30-minute call with our team.

Cover photo by ThisIsEngineering on Pexels.

Hephaestus Technology

We help founders and businesses validate, build and launch products across software, AI and hardware, from offices in Ho Chi Minh City, Dublin and Delaware. See how we work.

Tell us what
you're building.

A free 30-minute call. You'll get an honest view of the idea, the risks we see and what we'd do first, whether or not we end up working together.