<code>verify</code> establishes its trust anchor from inside the very directory it is validating: the manifest signature is checked against <code>${pub}/owner_root.pub.pem</code>, and the generation/anti-rollback check reads <code>generation=</code> from that same manifest. An attacker who can modify the public bundle in transit (backup stick, copy back to the Spark) simply generates their own Ed25519 root, writes a manifest with their own role fingerprints and a high <code>generation</code>, signs it, and ships <code>owner_root.pub.pem</code> alongside — every check prints PASS, so the tamper and rollback protections provide no real integrity guarantee. The verification should pin the expected <code>owner_root</code> fingerprint out of band (e.g. required argument/stored anchor on the verifying host) and compare the observed generation against a locally persisted high-water mark rather than a caller-supplied minimum.
To fix this without changing core functionality, make <code>verify()</code> require an out-of-band trusted <code>owner_root</code> fingerprint and optionally enforce a local high-water generation file:</p> <ul> <li>Pin trust anchor out-of-band: Add a required verify argument for expected <code>owner_root</code> SHA-256 fingerprint (hex). Compute actual fingerprint of <code>${pub}/owner_root.pub.pem</code> and fail if mismatch before signature verification. This prevents key-substitution attacks.</li> <li>Use local persisted anti-rollback state: Add optional verify argument for a high-water mark file path. If provided and exists, read prior max generation and reject bundle generation lower than that. On successful verify, update the file to the new generation if greater. This ensures rollback protection is host-local and attacker-independent.</li> <li>Keep existing <code>min_gen</code> support for compatibility, but enforce effective minimum as max(<code>min_gen</code>, persisted high-water).</li> </ul> <p>Edits are confined to <code>scripts/trust1_key_ceremony.sh</code>, inside the shown <code>verify()</code> function region.