Section 1.46

Recovery authority

Definition

Recovery authority is the power to bring a system back under control when its normal means of control has been lost or can no longer be trusted, together with the party or credential that holds that power. Typical recovery operations install a new management key after the old one was lost or stolen, or reinstall known-good software after a failed update. Because recovery exists for when the normal path has failed, it can do what the normal path cannot, which makes it a second way to control the system.

The idea

A vendor manages a fleet of devices. Each device obeys a command only if the command carries a valid tag computed with the management key KK; a tag is a short value that only a holder of KK can compute. One day KK leaks. The vendor wants to replace it, but a command that installs a new key must carry a valid tag, and any tag the vendor can compute with KK the attacker can compute as well. The device cannot tell the vendor from the attacker. The vendor needs a second credential that the attacker does not have: a recovery key §5.31 RR, kept offline and used only to replace a lost or compromised management key.

A spare house key is a fair picture. The spare exists for the day the normal key is lost, and the lock is no safer than the place where the spare is hidden. A burglar looks for the spare, not for a way to pick the lock. The picture stops being accurate in two respects. A spare house key opens everything the lock protects, whereas a recovery credential can be limited to named operations. And a device can record every use of its recovery credential where the owner sees it, which a lock cannot.

How it works

Write recovery authority down as an explicit list, in this order.

  1. When recovery may be used: at any time; only after the normal key has been declared compromised; only in a recovery mode entered by a physical action at start-up, such as holding a button; or only after a waiting period during which the owner can object.

  2. What recovery may do: for example install a new management key, revoke the old one, reinstall a known-good software image, or erase the device.

  3. What recovery may not do, stated just as explicitly: for example lower the minimum software version the device accepts, reinstate a revoked key, replace the root of trust §1.33 (the key or code that the device trusts without any further check), or read stored secrets.

  4. What each request is bound to: the identity of the target device, the exact operation and a freshness value, such as a counter that must exceed the last value accepted. Without that binding, a recorded recovery message can be sent again later, or to a different device, and still be accepted.

  5. What authority the result grants: after recovery the new key holds the normal role, the old key holds none, and the recovery credential keeps its own, separate role.

Recovery meets two rules of the normal path. Key rotation §5.29, the planned replacement of a key by a new one, typically numbers each key with a generation and accepts a new key only if its generation is higher than the current one, so that an old key, possibly leaked, never returns. Anti-rollback §8.26 refuses software older than a stored minimum version, which only ever rises, so that a version with a known flaw cannot be reinstalled. A recovery path that ignores either rule reopens what the rule closed.

Protect the recovery credential more strongly than the normal one, because it is more powerful and used rarely. Make it the private key of a digital signature §5.14 scheme, in which a private key creates signatures and a matching public key can only check them. The device then stores only the public key, so taking a device apart reveals nothing that lets anyone issue recovery commands. Keep the private key offline, on a computer that is never connected to a network. Split it among several people so that, for example, any 3 of 5 must cooperate to use it, which is called threshold secret sharing §5.44. Record every use where the owner can see it.

Worked example

A device holds a management key of generation 3. Two years ago the vendor used the recovery key RR to install the generation-2 key. That recovery message carried a digital signature made with RR, a value that only the holder of RR can compute and that the device checks with a public key it stores. The message traveled over the radio, and an attacker recorded it. Last year the generation-2 key leaked, and the vendor rotated to generation 3. The attacker now sends the recorded recovery message again. Its signature is genuine, and it asks the device to install the generation-2 key, which the attacker knows.

The same device refuses software below version 8, its stored minimum, because version 7 has a known flaw. Its recovery rule says: after 3 failed start-ups in a row, start the image in the recovery slot, a reserved area of memory that holds version 5, written and signed by the vendor at the factory. An attacker who holds the device cuts the power during start-up 3 times. The device counts 1, 2, 3 failed start-ups and starts version 5, older than the minimum because 5<85 < 8. Version 5 predates the repair that version 8 brought, so the flaw that the minimum was meant to exclude is back. Either of two repairs works. The recovery path can check the minimum too: finding 5<85 < 8, it waits in a minimal mode that accepts only a signed image of version 8 or later. Or every normal update can also refresh the recovery slot, so that the recovery image is never below the minimum.

Stated precisely

Describe authority as the set of state changes that each credential may cause. Let ss be the device’s state: the current management key and its generation gg, the set of revoked keys, the minimum accepted software version vminv_{\min} and the installed software. For a credential cc, let T(s,c)T(s, c) be the set of state changes that the device accepts when they are requested with cc in state ss. Then T(s,K)T(s, K) is the authority of the management key KK, and T(s,R)T(s, R) is the recovery authority of RR.

Let a protected property be a condition on states that must stay true, such as: gg never decreases, no revoked key becomes the management key again, and vminv_{\min} never decreases. The property holds for the system only if every change in T(s,K)T(s, K) and every change in T(s,R)T(s, R) preserves it, in every state ss. An exception for RR is legitimate only if the recovery policy names it, and the security claim must then state it as an exception.

The power of RR is larger than T(s,R)T(s, R) alone. If RR may install a management key of the holder’s choice, then whoever holds RR can also do everything that key can do afterwards. The effective authority of RR is every state reachable by a sequence of changes, each allowed either to RR or to a key that RR can install.

A valid signature made with RR establishes that the request came from a holder of RR. Whether the requested change belongs to T(s,R)T(s, R) is a separate check that the device must make on every request.

Limits and common mistakes

A strong normal path does not make up for a weak recovery path. An attacker takes whichever path to the same power is easier, so the system is no stronger than its weakest path to that power.

A rarely used path is rarely tested. Exercise recovery code and recovery procedures regularly. A recovery that fails on the day it is needed provides no availability §1.10, and one with an unnoticed flaw provides an unnoticed way in.

The recovery credential needs its own replacement plan. If RR leaks, something must be able to revoke and replace it, typically a higher key or a root key §5.25 fixed in the device’s read-only memory. The chain ends at a credential that cannot be replaced; if that one is stolen, the devices cannot be brought back under the vendor’s sole control, only replaced.

Recovery without a credential, such as a button that restores factory settings, grants recovery authority to anyone with physical access. That is acceptable only if the threat model §1.2 excludes attackers with physical access, or if the reset also erases every secret and every grant of trust, and the choice must be stated.

Erasing a device is a form of recovery that protects stored secrets and gives up the service and the stored data. It trades availability for confidentiality §1.8.

“It is only used in emergencies” is not a security argument. How often a credential is used says nothing about how hard it is to steal, and a recovery path that can be triggered by an attacker, as in the power-cut example, is used whenever the attacker chooses.

Questions answered

Can recovery credentials bypass normal key rotation or version rules?

They can only if the recovery policy explicitly grants that power, and a sound design grants as little of it as possible. A recovery credential is a key or procedure that regains control of a system when the normal management key is lost or in an attacker’s hands. Recovery must bypass one rule by its nature: it acts without the consent of the current management key. It should not bypass the rules that only ever move forward. Key rotation, the planned replacement of keys, accepts a new key only if its generation number is higher than the current one; recovery should apply the same check, or a recorded recovery message can reinstall an old, leaked key. Anti-rollback refuses software below a stored minimum version; recovery should refuse it too, or recovery becomes a way to reinstall software with a known flaw, for example by forcing repeated failed start-ups until a fallback image runs.

Where the policy does allow an exception, such as installing an older image when no newer one exists, the policy should name the exception, bind each recovery request to one device, one operation and a freshness value, and record every use where the owner can see it. The security claim should then state the exception.

Related entries: Recovery key (§5.31), Key rotation (§5.29), Root of trust (§1.33), Rollback versus anti-rollback (§8.26), Version high-water mark (§8.27), Key revocation (§5.32), Threshold secret sharing (§5.44), Recovery and anti-rollback can conflict (§17.11).