Try Embedded

Product security: interview questions

6 Product security questions embedded interviewers ask, each with a model answer. What does secure boot guarantee, and what does it not? Where should…

What does secure boot guarantee, and what does it not?

It guarantees that the device only runs code signed by the holder of a particular private key, by having each boot stage verify the next stage's signature before running it, starting from an immutable root of trust. It does not guarantee that the signed code is free of vulnerabilities, that it is the latest version (without anti-rollback), that the firmware is confidential (signing does not encrypt), that secrets in the firmware are safe from a dump, or that the device cannot be attacked through its debug port, its update protocol or physically. It also fails entirely if the signing key leaks or the root of trust can be modified.

Where should cryptographic keys live in an embedded device?

The signing key for firmware never lives in the device: it stays in a hardware security module or an offline signing system. The device holds the public verification key, or its hash, in memory that cannot be changed (OTP fuses, a protected bootloader). The device's own secrets, its identity key and any keys for decrypting images or talking to its cloud, belong in hardware made for them: a secure element (ATECC608, SE050, OPTIGA), the MCU's key storage or TrustZone secure world, or at minimum flash covered by readout protection. They should be unique per device, generated on it or injected at a secured manufacturing step, so that extracting one compromises one device.

How do you design an over-the-air update that cannot brick the device?

Two application slots: download and write the new image into the inactive slot while the running one stays intact; verify it completely (signature, hash, hardware compatibility, version against the anti-rollback counter); then switch with one small, atomic write of a boot record that has a sequence number and CRC. Boot the new image on trial with the watchdog running; the image confirms itself only once it has initialised, reached the update server and passed self-tests; a reset before that makes the bootloader roll back. Raise the anti-rollback counter only on confirmation. Keep the bootloader out of routine updates, and keep a recovery path, such as a third minimal image, for when both slots fail.

What makes a comparison constant time, and why does it matter?

Its execution time does not depend on the values compared: it reads every byte, combines differences without data-dependent branches (diff |= a[i] ^ b[i]), and decides once at the end. It matters for any comparison against a secret, a PIN, a password, a MAC or a key check, because an early-exit comparison takes longer the more leading bytes match, and an attacker who can time responses recovers the secret byte by byte with far fewer guesses than brute force. The property must hold in the compiled code, so check the disassembly or use an audited constant-time function.

What is a glitch attack, and how do you design against one?

Briefly violating the chip's operating conditions, with a dip in the supply voltage, a shortened clock cycle, an electromagnetic pulse or a laser, at a chosen moment so that it mis-executes without crashing: an instruction is skipped, a loaded value is wrong, a branch goes the other way. Attackers aim at single security decisions such as a signature check or a readout-protection test. Defences assume one fault per attempt: default to failure, use multi-bit values for success and failure, repeat critical checks independently and compare, count the steps of critical sequences, add random delays, and treat inconsistency as an attack. Hardware glitch detectors and tight brown-out levels help, and the most sensitive operations go to secure elements designed against fault attacks.

What do security standards for connected products require of the firmware?

ETSI EN 303 645 (consumer IoT, and the basis of the UK's PSTI rules and much of the EU's Radio Equipment Directive requirements) asks for no universal default passwords, a vulnerability disclosure policy, software updates that are secure and available, securely stored credentials, secure communication, a minimised attack surface (unused ports and debug interfaces closed), software integrity (secure boot), resilience to outages and protection of personal data. IEC 62443-4-2 sets component requirements for industrial devices at security levels 1 to 4, and NIST SP 800-193 covers platform firmware resilience: protection, detection of corruption and recovery. In practice they all lead to the same firmware features: signed updates with rollback protection, per-device credentials in protected storage, locked debug access, and a way to recover a corrupted device.