Skip to main content
← Back to Blog

Cybersecurity

Secure Boot Implementation for Automotive ECUs: Chain of Trust from ROM to Application

By Shreyansh, Founder & CTO, Agnile Technologies·April 30, 2026·11 min read

Key Takeaways

TL;DR — Automotive Secure Boot anchors a chain of trust in an immutable ROM and a hardware-fused root key, then verifies each downstream stage — first-stage bootloader, second-stage bootloader, application, OTA images — against signatures the HSM validates. Production-grade designs combine ECDSA P-256 or P-384 for present-day signing, monotonic counters for rollback protection, secure-debug authentication to close the alternative path, and post-quantum hash-based signatures (LMS, XMSS, SLH-DSA) for new firmware-signing roots given 15–20-year vehicle lifetimes. The work products feed directly into ISO/SAE 21434 Clause 10 (WP-10-01, WP-10-04) and address the Annex 5 firmware-modification threats UNECE R155 expects to see mitigated.

  1. 1.The chain of trust must be immutable at the root: a hardware-fused public key in OTP, verified by ROM, with no field-replaceable predecessor.
  2. 2.ECDSA P-256/P-384 is the present-day signing standard (FIPS 186-5); RSA-PSS 3072/4096 remains in legacy systems; PQC (LMS, XMSS, SLH-DSA) is appropriate for new firmware-signing hierarchies given vehicle longevity.
  3. 3.Rollback protection requires a monotonic counter in fused storage and a minimum-version check enforced by the Secure Boot Manager itself — not just by the signed manifest.
  4. 4.Glitching, voltage-fault injection, and pre-Secure-Boot UART/JTAG access remain the highest-yield public attack classes; secure-debug authentication-gating is the principal mitigation alongside hardware countermeasures.
  5. 5.AUTOSAR Classic supplies the Secure Boot Manager (SBM) and Flash Bootloader (FBL) integration; AUTOSAR Adaptive uses Platform Health Management and startup configuration verification.
  6. 6.Secure Boot is the most direct mitigation in UNECE R155 Annex 5 for firmware-modification threats and is core ISO/SAE 21434 Clause 10 evidence.

At a Glance

One-Sentence Answer
Secure boot protects ECU software integrity by verifying each stage of the boot chain before execution.
Who This Is For
Embedded software engineers, ECU teams, cybersecurity engineers, bootloader teams, and vehicle platform architects.
Last Reviewed
May 2026
Primary References
Secure boot, hardware roots of trust, HSM, ECU software integrity, ISO/SAE 21434 implementation support.
Practical Use
Use this guide to reason about ECU boot-chain protection, update trust, rollback prevention, and security validation.

Secure Boot is the load-bearing control behind the cybersecurity of every modern ECU. If the chain of trust holds from power-on, an attacker who replaces firmware fails to boot the vehicle; if the chain breaks anywhere — root key, signature algorithm, rollback policy, debug port — the ECU runs the attacker's code and every other control downstream becomes irrelevant. This post is the implementation view: how the chain is built, how the keys are managed, where the attacks land, and how the resulting work products map into ISO/SAE 21434 Clause 10 and UNECE R155 Annex 5.

Why Secure Boot matters more in vehicles than in IT

IT systems get patched. Vehicles get serviced. The same firmware runs in tens of thousands of identical ECUs, each of them physically reachable by a sufficiently determined attacker, each of them in service for fifteen to twenty years. Three properties of the automotive context shape the Secure Boot design that an enterprise design does not have to plan for:

  • Physical access is realistic. Removing the ECU and probing it on a bench is a routine attack. The threat model cannot exclude the OBD-II port, the diagnostic connector, or the unsoldered chip.
  • Long lifetimes. Cryptographic decisions made in 2026 must hold against attackers in 2041. Algorithm agility and post-quantum readiness are procurement requirements, not research curiosities.
  • Supply chain. Firmware crosses ownership boundaries between OEM, Tier-1 supplier, silicon vendor, and contract manufacturer. Each handoff is a place the chain could be subverted; Secure Boot is the runtime check that the firmware loaded is the firmware that was signed.

Chain of trust fundamentals

A Secure Boot chain has four typical stages: an immutable ROM, a first-stage bootloader, a second-stage bootloader, and the application image. Each stage verifies the signature of the next stage against a public key it inherited from the stage above. The root of the chain is a public key fused into one-time-programmable storage at silicon manufacture and read by ROM at every power-on.

Hardware Root of TrustOTP-fused public key · immutable ROM · HSMverifies signatureFirst-Stage Bootloader (FSBL)minimal, signed by root key · brings up SDRAM, debug-gating, HSM bridgeverifies signatureSecond-Stage Bootloader (SSBL)full hardware init · A/B image selection · rollback counter checkverifies signatureApplication ImageAUTOSAR BSW + RTE + SWCs · runs only after all upstream verifications passOTA images traverse the same chainAny verification failure halts the chain and enters recoveryrollback counter is checked before signature verification — both must pass
Chain of trust from hardware root through application. Each stage verifies the next; OTA images traverse the same chain. Any verification failure halts the boot and enters the recovery path.

Key management and hierarchy

The signing key hierarchy mirrors the chain of trust but lives in the OEM's key-management infrastructure rather than on the vehicle. A typical hierarchy: a hardware-fused root public key in the ECU; an offline OEM root signing key whose public part the fused key represents; intermediate signing keys for firmware classes (bootloader, application, calibration); per-ECU diversified keys for any per-unit cryptographic state. The root's private key never leaves an offline HSM; signing ceremonies are scheduled events with dual control. The intermediate keys do the day-to-day signing and rotate on a defined schedule. The fused public key in the ECU is the only thing that cannot be rotated in the field — choose it deliberately and back it with PQC where the hardware allows.

Signature schemes for automotive Secure Boot

SchemeReferenceUse
ECDSA P-256FIPS 186-5 (2023)Default for new designs; small signature, fast HSM verify
ECDSA P-384FIPS 186-5Higher security margin where verify latency permits
RSA-PSS 3072/4096FIPS 186-5Legacy continuity; not recommended for new programmes
LMS / HSSNIST SP 800-208PQC firmware signing (stateful hash-based)
XMSSNIST SP 800-208PQC firmware signing (stateful hash-based)
SLH-DSAFIPS 205 (Aug 2024)PQC firmware signing (stateless hash-based)
Signature schemes for automotive Secure Boot. ECDSA for present-day designs; RSA only where legacy continuity requires; hash-based PQC for new firmware-signing roots given vehicle lifetime.

Implementation patterns

Fixed root of trust (ROM and fuses)

The dominant pattern. The ROM is mask-programmed at silicon manufacture; the root public key is fused (or, more commonly, the SHA-256 hash of the root public key is fused, with the key itself supplied as part of the FSBL package). At power-on, ROM reads the fuses, hashes the supplied key, compares, then verifies the FSBL signature with the supplied key. Tamper-evidence comes from the fuses; immutability comes from the mask ROM.

Measured Boot (TPM-style measurement log)

In addition to verifying each stage, the boot code records a hash of each loaded image into a measurement log held by the HSM or a TPM. A remote verifier can later request the log and decide whether the chain of measurements matches an expected reference. Measured Boot is complementary to Verified Boot, not a substitute: Verified Boot blocks bad images; Measured Boot records what was loaded.

Secure debug (auth-gated JTAG/SWD)

Production debug ports are either fused-off or gated by an authenticated challenge-response. The challenge comes from the silicon, the response is signed with a key the OEM controls, and only valid responses unlock the debug interface. This pattern preserves the ability to do field diagnostics while removing the alternative path that would bypass Secure Boot entirely.

AUTOSAR Classic integration

On AUTOSAR Classic, two work items integrate with the platform: the Flash Bootloader (FBL), which is responsible for receiving update images and managing flash, and the Secure Boot Manager (SBM), which performs the verifications along the chain. Vendor BSW packages typically supply both, keyed to the silicon's HSM. The SBM enforces the minimum-version check against the rollback counter and invokes the HSM through the AUTOSAR Crypto Stack — Csm, CryIf, Crypto Driver — for the signature verification itself.

AUTOSAR Adaptive integration

On AUTOSAR Adaptive (POSIX-class compute), the responsibilities shift. Platform Health Management (PHM) handles startup configuration verification; the platform's own boot firmware (often a UEFI-derived chain or a vendor secure boot) anchors the trust before Adaptive itself starts. Application-level integrity continues to flow through the KeyM/Csm equivalents. The principle is the same: every stage verifies the next; the chain has no field-replaceable root. For the Classic-versus-Adaptive split see our companion piece on AUTOSAR Classic vs Adaptive.

Signature verification flow

The diagram below shows the verification a Secure Boot Manager performs at every stage transition. The same flow runs on power-on (FSBL → SSBL → application) and on OTA install (incoming image → application).

  1. 1

    Read image header and manifest

    Locate the image, parse the manifest (version, algorithm identifier, signature offset, image length), reject obviously malformed manifests.

  2. 2

    Check rollback counter (minimum version)

    Compare manifest version against the monotonic counter in fused storage. Reject if the image version is below the stored minimum, before signature verification.

  3. 3

    Compute image hash (SHA-256 or SHA-384)

    Stream the image through the HSM hash engine in chunks; for large images, watch the hardware watchdog and pet it during the hash.

  4. 4

    Verify signature against trusted public key

    HSM performs ECDSA-P256-Verify (or the configured algorithm) using the public key bound to this stage. Constant-time, glitch-aware implementation.

  5. 5

    On success: update measurement log, increment counter

    Append the image hash to the Measured Boot log. Update the rollback counter to the manifest version if higher than the stored value.

  6. 6

    On success: transfer execution to verified image

    Lock down the public-key region, clear scratch memory, and jump to the verified entry point.

  7. On any failure: enter recovery path

    Roll forward to a known-good A/B slot, attempt recovery firmware, or halt with a diagnostic code. Never fall through to executing unverified code.

Signature verification flow inside the Secure Boot Manager. The rollback check (step 2) precedes signature verification (step 4) so that a previously signed but vulnerable image cannot be replayed even when the signature still validates.

Attack vectors and mitigations

Public research on Secure Boot attacks converges on six classes. Each has a corresponding mitigation that mature designs implement; missing any of them tends to predict the fastest path to compromise.

  • Voltage and clock glitching: the attacker injects a transient at the moment the verification routine is checking the result. Mitigation: hardware countermeasures in the HSM (voltage monitors, clock-integrity checks), redundant verification with diverging code paths, and a fail-secure design that treats anomalies as failure.
  • Fault injection (laser, EM): precision attacks on specific instructions. Mitigation: constant-time cryptographic primitives, redundant hash and signature verification, sensors in the HSM package.
  • ROM bugs: defects in mask-programmed code cannot be patched. Mitigation: rigorous review and Penetration Testing of ROM before tape-out, recovery firmware that can compensate for narrow ROM defects via FSBL-side checks.
  • Rollback: the attacker re-flashes a previously signed but later-vulnerable image. Mitigation: monotonic counter in fused storage, minimum-version check enforced by SBM not just by manifest.
  • Pre-Secure-Boot UART/JTAG: debug interfaces active before the chain locks down. Mitigation: fuse-disabled or auth-gated debug, with the gate active before any external interface is enabled.
  • Supply-chain firmware substitution: a bad image is signed before it reaches the OEM. Mitigation: disciplined PKI ceremony, air-gapped signing, dual control, and SBOM verification at the OEM ingress.

Rollback protection in detail

Rollback protection is the control most often partially implemented. Two artefacts must be present: a monotonic counter held in fused or anti-rollback hardware storage that cannot be decremented, and a minimum-version field in every signed manifest. The Secure Boot Manager reads the stored counter, compares against the manifest's version, rejects the image if it is below the stored minimum, and after successful boot updates the counter to max(stored, manifest.version). The check belongs in the SBM. Designs that rely solely on the manifest declaring a minimum version are bypassed by the attacker re-using an older legitimately signed manifest.

Secure Boot at scale

Three operational concerns dominate when Secure Boot moves from prototype to fleet:

  • Factory provisioning. Per-ECU diversification at end-of-line is non-negotiable; a single shared key across a part number is a single-point compromise. The provisioning flow itself must be authenticated against the tester, logged, and reproducible for audit.
  • Recovery key escrow. An OEM that cannot recover from a lost intermediate key has either lost the fleet or accepted permanent vulnerability; both are unacceptable. Escrow under dual-control and offline HSM custody is the standard answer.
  • OTA compatibility. The OTA pipeline must produce images that traverse the same chain as factory- flashed firmware. A separate signing key for OTA is a red flag; it usually indicates the chain has not been reasoned through from boot ROM to OTA package.

ISO/SAE 21434 and UNECE R155 mapping

The Secure Boot architecture document, the key-management specification, the verification report, and the threat-vs- mitigation table together produce the Clause 10 evidence ISO/SAE 21434 expects (WP-10-01 cybersecurity controls specification, WP-10-04 cybersecurity verification report). Against UNECE R155, the same artefacts directly address Annex 5 firmware-modification threats. The HSM that performs the verifications is documented separately (see our companion post on HSM integration for automotive ECUs); the Secure Boot work products reference it. For the broader R155 view see ISO/SAE 21434 vs UNECE R155; for the work-product map see the ISO/SAE 21434 Work Products checklist.

Take-aways

Secure Boot is not a feature; it is the foundation every other ECU cybersecurity control rests on. The architectural decisions that matter — root key choice, signature scheme, rollback policy, debug gating, post-quantum readiness — are made before silicon is locked. Programmes that treat Secure Boot as an integration task discover late that the silicon cannot meet the verification latency, the key-management infrastructure was not procured, and the rollback counter has nowhere to live. Programmes that treat it as an architecture decision pay the cost once and move on.

Agnile Technologies designs and verifies Secure Boot implementations across the major automotive silicon families, from chain-of-trust architecture through key- management infrastructure and Penetration Testing of the resulting design. Work products map directly to ISO/SAE 21434 Clause 10 and UNECE R155 Annex 5.

Frequently Asked Questions

Is Secure Boot mandatory under UNECE R155?

R155 does not name controls. It requires that the firmware-modification threats listed in Annex 5 are mitigated and that evidence of mitigation is produced. Secure Boot is the dominant mitigation for those threats and is the control most Type Approval files reference, but the regulation is technology-neutral. A different control set that demonstrably defeats the same threats is acceptable in principle; in practice no other architecture has emerged at parity.

ECDSA or RSA for Secure Boot signatures?

ECDSA P-256 or P-384 for new designs. Smaller signatures, smaller keys, faster verification on the HSM, and the algorithm of choice in FIPS 186-5 (2023). RSA-PSS 3072 or 4096 remains in legacy systems and is acceptable where it is already in production, but new programmes that pick RSA today inherit a slower verification path and a larger image footprint without offsetting benefit.

Why think about post-quantum now?

Vehicles built today will be on the road into the 2040s. A firmware-signing root issued in 2026 must remain trustworthy at the end of that vehicle's service life. NIST SP 800-208 (LMS, XMSS) and NIST FIPS 205 (SLH-DSA, August 2024) provide stateful and stateless hash-based signatures suitable for firmware-signing roots today. ML-DSA (FIPS 204) is the long-term general-purpose candidate. The decision affects key-management infrastructure procurement, which has a long lead time.

Measured boot or verified boot?

Both, when warranted. Verified Boot blocks a bad image at the verification step — the ECU refuses to run an image whose signature does not match. Measured Boot records a hash of each loaded stage in a measurement log so a remote verifier can inspect the chain after the fact. Verified Boot is the load-bearing control; Measured Boot adds attestation. Production designs commonly use both.

Can OTA bypass Secure Boot?

Only by design failure. An OTA image is firmware; firmware traverses the chain of trust like any other image. The chain must be defined to require the same verification on OTA as on factory-flashed firmware, and rollback protection must enforce a minimum version so an attacker cannot flash a previously signed but vulnerable image.

Is JTAG safe to leave open in production?

No. Production JTAG and SWD must be disabled by fuse or gated by authenticated debug — a challenge-response that requires a key the OEM controls. Open debug ports remain among the highest-yield attack vectors in published research. Secure-debug authentication does not replace Secure Boot; it removes the alternative path that bypasses it.

What is the most common Secure Boot mistake?

No rollback protection. The signature checks pass, the chain of trust holds, and an attacker still wins by flashing a previously signed but later-found-vulnerable image. A monotonic counter in fused storage and a minimum-version check enforced by the Secure Boot Manager — not just by the manifest — closes the gap.

Need Help Applying This to a Real Programme?

Agnile supports engineering teams from architecture and requirements through implementation, validation, release, and evidence preparation.