Definition
Measured boot is a way of starting a device in which each boot stage computes a cryptographic hash §5.1, a short fingerprint, of the next piece of software before running it, and records that value, called a measurement, where later software cannot erase it. Attestation is a protocol in which the device sends a remote verifier a signed report of its measurements, so that the verifier can judge which software the device loaded. Measured boot only records: unlike secure boot §6.31, which refuses to run unapproved software, it lets any software run.
The idea
A server that manages a fleet of sensors wants to know, before it sends a sensor a new key, whether the sensor still runs the firmware its vendor shipped. Asking the sensor is useless on its own: firmware that an attacker has replaced can answer “yes” as easily as the genuine firmware can. The answer must come from something that the replaced firmware cannot control.
Measured boot supplies that something. The first code that runs after reset is fixed in hardware or in memory that cannot be rewritten, and it is trusted without being checked. It measures the next stage before handing over control, that stage measures the stage after it, and so on. Each measurement is recorded before the measured code runs, so malicious code finds its own measurement already recorded. Recording is one-way: software can add a measurement but cannot remove or overwrite one. Attestation then has a protected key sign the record, and the verifier compares the record with the measurements of approved software.
A visitor book written in ink at a building entrance is a fair picture: each visitor is entered before going in, and the book stops nobody and says nothing about what a visitor did inside. Where the picture fails is the guard: a building has one trustworthy guard, while a boot has a chain of stages, each the guard for the next, so a dishonest stage can write anything about the stages after it.
How it works
The parts, in plain words:
Measurement: the cryptographic hash of a component’s bytes, for example with SHA-256 §5.2 (Secure Hash Algorithm with a 256-bit output), which gives 32 bytes. Changing any byte of the component changes the measurement.
Root of trust §1.33 for measurement: the first code that runs after reset, kept in read-only memory or in flash that is locked against writing, so that no software can change it. It is trusted without being measured.
Measurement register: a register that holds a running summary of all measurements so far. Software can only extend it, as described below, never write it directly. A TPM (Trusted Platform Module), a security chip found mainly in personal computers and servers, calls such a register a platform configuration register (PCR).
Event log: an unprotected list, in ordinary memory, of each measured item and its measurement. The verifier checks the log against the register.
Attestation key: a signing key whose private half only the attestation component (the TPM, or protected firmware in the same role) can use, and whose public half the verifier trusts as belonging to one genuine device.
Measured boot and attestation then run in this order.
At reset, the measurement register is set to 32 zero bytes.
The root of trust reads the next stage, typically the bootloader §6.30, computes its measurement, and extends the register: the new register value is the hash of the old value followed by the measurement. It appends the name of the stage and the measurement to the event log, and only then starts the stage.
Every measured stage does the same for each stage it starts: measure, extend, log, then run.
Later, the verifier sends a nonce §5.18: a fresh random value, so that a report made earlier cannot be sent again and accepted.
The attestation component signs the current register value together with the nonce, using the attestation key. The signed result is called a quote. The device returns the quote and the event log.
The verifier checks the signature with the trusted public key and checks that the quote contains its nonce. It replays the event log: starting from 32 zero bytes, it extends with each logged measurement in order and checks that the result equals the signed register value. Finally it compares every logged measurement with the reference values, the measurements of approved software published by the vendor or the owner, and reports its verdict to the party that relies on it, such as the server about to send a key.
The extend operation is what makes the record trustworthy. A cryptographic hash cannot be run backwards, so no sequence of extend operations brings the register to a value chosen in advance. The only way to start over is a reset, and a reset starts the whole chain again from the root of trust. A replaced bootloader can still add measurements, but it cannot remove its own, which the stage before it has already recorded. Order counts too: the same two measurements extended in the opposite order give a different register value.
Most microcontrollers §6.1 have no TPM. The Device Identifier Composition Engine (DICE), a specification of the Trusted Computing Group (TCG), gets a similar result from key derivation. At reset, hardware combines a unique device secret (UDS), a per-chip value that only this step can read, with the measurement of the first updatable code, giving a compound device identifier (CDI), and then hides the UDS until the next reset. Each layer computes the next layer’s CDI from its own CDI and the next layer’s measurement, derives its signing keys from its own CDI, and erases its own CDI before starting the next layer. Other code gives another CDI and other keys, so a device that runs other code cannot sign with the keys of the expected code.
RFC 9334, the Remote Attestation Procedures (RATS) architecture of the IETF [399], names the roles: the attester (the device) produces evidence, here the quote and the log; the verifier appraises the evidence against reference values; the relying party acts on the verifier’s result.
Worked example
To keep the numbers checkable, let the two boot stages be the ASCII strings bootloader v1 and app v7 instead of real images. Let be SHA-256, and write for the bytes of followed by the bytes of . Every value below is 32 bytes long; only its first 8 bytes are printed, in hexadecimal, followed by dots. The reference values are the measurements of these two strings:
=
b62b2bd39a8f82a1…=
0f5151d4c248ee1a…
The register starts as , 32 zero bytes. The root of trust measures the bootloader and extends the register with , hashing bytes. The bootloader then measures the application and extends with :
=
68479b472b7c4ffb…
=5fa64f749de4ae11…
The verifier sends the nonce 5a3c91e7 (4 bytes, short for this example; real nonces are 16 bytes or longer). The device returns a quote, a signature over and the nonce, together with the log . The verifier checks the signature and the nonce, then replays the log from and obtains 5fa64f749de4ae11…, which equals the signed . Both logged measurements are reference values, so the verifier accepts.
Now an attacker installs app v8. Measured boot does not stop it: the bootloader measures = d82d0e379060c3cd…, extends, and runs the application, so the register ends at = 7c5636da144a2d59…If the device reports the true log, is not a reference value and the verifier rejects. If the device lies and logs , the replay gives 5fa64f74…, not the signed 7c5636da…, and the verifier rejects again. A lying log could match only if the attacker found an approved with , which SHA-256 is designed to make infeasible. Order is checked too: extending before gives 661cb951bf93a3a9…, a third value.
Finally, suppose the genuine app v7 runs, and a buffer overflow §4.4, a write past the end of a buffer, lets an attacker overwrite a function pointer in RAM. No measured byte has changed. The next quote again carries = 5fa64f749de4ae11…, with a fresh nonce and a valid signature, and the verifier accepts. The quote is true: app v7 was loaded. It says nothing about what the device does now.
Stated precisely
Let be the hash function and its output length in bits. Let be the components in the order in which they were loaded since the last reset, and let be the measurement of component . Write for followed by , and for zero bits. The register obeys A quote is : a signature, made with the attestation private key , over the register value and the verifier’s nonce .
The verifier accepts when four checks pass: verifies under a public key that the verifier trusts to belong to the device it means to assess; the signed nonce equals the nonce that the verifier issued for this exchange and has not used before; replaying the logged measurements from reproduces the signed ; and every logged measurement is a reference value.
Acceptance establishes this statement and nothing more: since its last reset, the device loaded exactly the logged components, in the logged order, and its attestation component signed this record after the verifier issued . The statement rests on four assumptions.
Immutable root of trust. The root of trust for measurement ran first and cannot be modified.
Measure before run. Every measured stage measures and extends each component it starts, before starting it. A stage that breaks this rule can record anything for the components after it.
Protected key and register. Only the attestation component can use , it signs only the true register value, and no software can change the register except by extending it.
Collision resistance §5.5. Nobody can find two different inputs with the same hash, so a measurement identifies one component and a register value identifies one sequence of measurements.
Limits and common mistakes
Measured boot prevents nothing. Unapproved software runs, and the verifier merely learns of it. The protection comes from what the relying party then withholds, such as a key or network access. Secure boot enforces the boot policy by refusing to start an unauthorized image. A device can enforce that policy and also record what it loaded.
A measurement describes code at load time, not behavior at run time. Memory corruption, a misused feature or a malicious input changes what the device does without changing a measured byte. Research on runtime attestation goes further; control-flow attestation, for example the C-FLAT system of 2016 [400], reports the path the program took through its code, at a far higher cost than load-time measurement.
Only measured things are covered. Configuration files, keys, data read later, firmware inside other chips such as a radio, and code loaded after boot are invisible unless some stage measures them. And a known measurement is not a safe one: a version with a known vulnerability matches its reference value perfectly, so versions must leave the reference list once they are known to be vulnerable.
The measured copy must be the copy that runs. If a stage measures an image and then runs a copy that something else can rewrite in between, the measurement describes bytes that are not running, a time-of-check to time-of-use §9.26 (TOCTOU) error.
A nonce proves only that the quote was made after the nonce was issued, not anything about a later moment. The verifier must also tie the attestation key to the identity of the device it means to assess; otherwise an attacker can pass the verifier’s question to another genuine device and return that device’s answer.
Everything rests on the root of trust and the attestation key. If the first code can be modified, the chain proves nothing; if the private key leaks, an attacker can sign any register value.
Questions answered
What does a signed measurement prove about current runtime behavior?
A signed measurement proves nothing directly about current runtime behavior. It proves that a particular component, identified by its cryptographic hash, was loaded at the point in the boot where it was measured. When the signature also covers a nonce, a fresh random value that the verifier has just chosen, it proves in addition that the record was signed after the nonce was issued. Both proofs hold only if the first measuring code cannot be modified, every stage measured the next stage before running it, the signing key never left the attestation component, and nobody can find two inputs with the same hash.
The signed measurement does not show that the measured code is still the code that runs, that this code behaves as intended, or that unmeasured data such as configuration is unchanged. A memory-corruption attack after boot changes behavior without changing any measured byte, so the next signed report is still accepted. A claim about current behavior needs a runtime mechanism: enforcement, such as memory protection that stops the bad action, or runtime measurement, such as control-flow attestation, each with its own assumptions.
Related entries: Secure boot (§6.31), Digital signature (§5.14), Nonce (§5.18), Observation versus enforcement (§1.20), Replay attack (§1.26), Root of trust (§1.33), Cryptographic hash function (§5.1), Time-of-check to time-of-use (TOCTOU) (§9.26), Trusted computing base (TCB) (§1.4). Further reading: [399, 400].