Lion Cipher Lab

Verify FIDO2/WebAuthn attestation and enforce an authenticator allowlist with the FIDO Metadata Service

Why it matters

The predecessor lab, gs-verify-webauthn-assertions-from-scratch, built a WebAuthn relying party that verifies an ASSERTION -- a login -- and proved it rejects replay, wrong-origin phishing, and cloned authenticators. That lab deliberately used attestation fmt='none', because a login does not need to know which device you hold. This lab tackles the distinct and harder REGISTRATION-time question: not 'is this the key that registered?' but 'WHICH authenticator model made this credential, and is that model one my organization allows to enroll at all?'. That is the ATTESTATION problem, and it is…

What you'll learn

Steps in this lab

  1. The model: registration attestation vs. the login assertion you already verified
  2. Two codecs from scratch: a CBOR decoder and an ASN.1 DER encoder
  3. Mint a vendor CA and a software authenticator that emits a PACKED attestation
  4. Verify the packed attestation signature and read the AAGUID
  5. Build a signed FIDO Metadata Service BLOB (the shape of the real MDS3)
  6. Verify the BLOB against the pinned FIDO root, then index it by AAGUID
  7. Enforce the allowlist: internal validity + MDS trust + approved model
  8. Prove the four rejections: none, all-zero AAGUID, spoofed chain, revoked
  9. Optional: fetch the REAL MDS3 BLOB and confirm it is the same shape
  10. The judgment: when to require attestation, and when NOT to

Open the full interactive lab →