Skip to content
Pro lab

Certificate Pinning Lab

Certificate pinning fails on rotation, not on the day you turn it on. Publish a set of SPKI public-key pins, then rotate the server’s key — and watch the apps that update slowly hard-fail TLS because they still enforce the old pins. The lab drills the one habit that makes pinning survivable: pre-publish a backup key’s pin before you need it. Rotate with zero breakage, reject the mis-issued and stolen-key chains, and keep a clean backup for next time — and you pass.

0s

Goal

The fleet pinned only Leaf A’s key. Roll the certificate over without locking out apps that update slowly — and set up a safety net so the NEXT rotation can actually change the key.

Published pin set (SPKI pins you ship to clients)

sha256/9Qx4mZ1bK3p0r7T2uVwX8yA5cDeFgHiJkLmNoPqRs=

Rotation

Rotate the live leaf onto

Server then presents: leaf A → intermediate → root CA

Client populations (each enforces the last pin set it downloaded)

Web / short sessionspins leaf Aleaf A
Mobile app · quarterly updatespins leaf Aleaf A
Embedded devices · yearlypins leaf Aleaf A

Score vs goal

Edit the pin set and rotation, then validate. So far 0 fleet(s) would break and 0 attacker chain(s) are trusted.

Legend

A client survives only if its pinned set shares an SPKI with the new chain.

Amber pin — CA/intermediate (no breakage, but trusts all its certs).

Red pin — a compromised key you are still pinning.

Pre-publish a backup key’s pin before you need it — that is the whole discipline.

Live arena

4 active
adversary kill-chain1/4
pinning-you (you)100%
mobile-eng-lee17%
pki-lead-sam10%
sre-mara9%

adversary staging…

Loading…

Sample report · illustrative data

Sample result: Cert Pinning Lab debrief

Example run of the "renew without a key change" scenario: the published pin set and rotation target are chosen, then replayed against client populations and an attacker connection.

Choices made

Starting pin set
Leaf A only (the key the fleet already pins)
Published pin set
Leaf A and the offline backup key
Rotation target
The live certificate moves onto the backup key

Replay results

ConnectionHoldsOutcomeWhy
Web clients, short sessionsLeaf AKept workingTheir pin set shares a key with the presented chain
Mobile app, quarterly updatesLeaf AKept workingSlow updaters still hold the old pin set, which must overlap the new chain
Mis-issued cert from your CAn/aRejectedThe rogue leaf is not in the published pin set

How it is graded

A pass needs zero broken clients and every attacker rejected. The percentage drops for hygiene problems: no pins at all, a burned key still pinned, leaning on a broad CA pin, or no pre-published bridge key that lets the next rotation change the key without breaking slow clients.

Made-up example data. Your own run uses your inputs. Downloads of the full report need Pro.

TL;DR

What this lab is

5 points
  • A browser-based certificate-pinning lab: publish a set of SPKI (public-key) pins, then rotate the server’s key without hard-failing the apps that already trust the old pins.
  • Pinning is validated client-side against the newest pin set a client has downloaded — so slow-updating fleets still enforce an older set, which is exactly what breaks naive rotations.
  • The one discipline the lab drills: pre-publish a backup key’s pin BEFORE you rotate, so the next key is already trusted when it goes live.
  • Trade-offs are made concrete: pin the leaf (tight, but fragile to rotation), pin the intermediate/CA (rotates freely, but trusts every cert that CA issues), keep a pre-published backup (zero-downtime rotation).
  • Scored on zero client breakage plus rejecting mis-issued and stolen-key chains; difficulty adds slower fleets, frozen builds and compromise events.

Frequently asked questions

What is the Certificate Pinning Lab?

An in-browser exercise where you configure a set of SPKI public-key pins for an app and then rotate the server’s certificate/key, watching how deployed client populations react. Each client enforces the most recent pin set it has downloaded; a connection succeeds only if the presented certificate chain shares at least one pinned public key with that set. You are scored on rotating with zero client breakage while still rejecting mis-issued or stolen-key chains.

Why does pinning the leaf key break rotation?

If clients pin only the current leaf’s public key and you rotate to a new key, every client still enforcing the old pin will refuse the new certificate — the new key is not in their pinned set. Because slow-updating apps may hold that old set for months, you cannot safely change the key until the new key’s pin has already reached them. The fix is to pre-publish a backup key’s pin in an earlier release, or to renew the certificate while keeping the same key (the SPKI is unchanged).

What is a backup pin and why pre-publish it?

A backup pin is the SPKI of a key you have generated in advance (typically kept offline) but are not yet serving. Shipping its pin ahead of time means that when you later rotate the live key onto it, every client that updated in the meantime already trusts it — so the rotation causes no breakage. Pre-publishing the next key’s pin before the key goes live is the core habit of safe pinning, and it is what lets a key-compromise emergency be survivable instead of fatal.

Is this a real TLS stack?

No. It is a teaching model of SPKI pin validation (match any pinned public key in the presented chain) and update-lag across client populations. It deliberately ignores certificate expiry handling, OCSP/CRL revocation, HSTS and the exact HPKP/mobile-SDK encodings so the one lesson — pin the right thing and pre-publish the next key — is clear. The keys, pins and scenarios are invented.

The tools people use most on PlayCISO.

All tools