Safeguard
Security Guides•

What does MCUboot check before it boots a firmware image?

MCUboot checks an image header, a TLV block, a SHA256 hash and, if present, a signature matched by key hash. What each check proves and where keys live.

Safeguard Security Team
3 min read

MCUboot checks that an image starts with the expected magic number, that a TLV information block follows the payload, that the computed SHA256 matches the stored hash, and, when a signature is present, that it verifies against a key the bootloader trusts. Each check proves something different.

The checks in order

The MCUboot design documentation describes validation just before an image is copied into the primary slot.

  1. Header magic. The image must start with a defined magic value.
  2. TLV block. A type-length-value info block must sit right after the header and image.
  3. Hash. A SHA256 value is required, and the computed hash must match it. SHA384 and SHA512 types are also defined.
  4. Signature. If a signature TLV is present, a key hash TLV must be present too. The bootloader walks its embedded keys to find the match, then verifies. Defined types include RSA2048-PSS, ECDSA, RSA3072-PSS and Ed25519.

When protected TLVs exist, the hash covers the header, payload, protected TLVs and the TLV info header, so metadata you protect cannot be altered without detection.

What each check proves

CheckProvesDoes not prove
Header and TLV structureThe file is shaped like an imageAnything about origin
SHA256The bytes were not corruptedThat the right party made them
SignatureThe holder of a trusted private key approved the bytesThat the code is free of bugs

A hash alone cannot defend against a malicious replacement, because anyone can compute a hash. The signature is what ties the image to your key.

Where the public key comes from

MCUboot offers three styles. By default the hash of the public key is embedded in the bootloader and compared to the key hash TLV. With the hardware key option the key hash is provisioned on the device and the full key travels in the image. With the built-in key option, keys live in the crypto backend and are referenced by ID, currently only with the PSA Crypto backend for ECDSA.

Choose based on how you plan to rotate keys. A key baked into bootloader code can only change with a bootloader update, so decide that before you ship.

Questions to ask your own build

  • Is the signature mandatory in your configuration, or is hash-only allowed?
  • Which key signs release images, and who can use it?
  • Can a development key ever boot on production hardware?
  • What happens on validation failure: does the device hang, fall back, or report?

Where Safeguard fits

Safeguard supports compliance and evidence automation alongside SBOM and dependency scanning, so a record like this can be kept with your other evidence. Try the free scan at gold.safeguard.sh/scan on a repository you already own.

Quick check

Is the signature really optional in MCUboot?

The design documentation describes the signature as optional at the format level. A production device should be configured so an unsigned image is rejected.

Does the hash cover the whole image?

It covers the header, payload, protected TLVs and the TLV info header when protected TLVs are present.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.