Lion Cipher Lab

Stop apps from tracking users across each other with OIDC pairwise subject identifiers

Why it matters

When you click 'Sign in with ...' on a website, the identity provider sends that site a signed note about you, and one line of that note, the `sub` (subject) claim, is the permanent ID the site files you under. If the provider gives every site the SAME `sub`, then any two sites that share or leak their user tables can stitch your accounts together with a one-line database join, no matter how careful you were to use them separately. OpenID Connect has a built-in fix called pairwise subject identifiers: each site, or each group of sites run by one company, gets its own unrelated `sub` for you.…

What you'll learn

Steps in this lab

  1. The problem in one picture: one sub, every app
  2. Public vs pairwise, and the three rules a pairwise sub must follow
  3. Set up: Python and an empty folder
  4. Build the toy OP: registration, the sub, and the ID token
  5. Run it: one user, two RPs, public then pairwise (and a flaw in the literal recipe)
  6. Build a small world: 1,000 users and four RPs
  7. BEFORE: public sub, full claims. Every shared user is joinable
  8. AFTER, part 1: pairwise sub. The sub join drops to 0%, and nothing else moves
  9. AFTER, part 2: minimise the claims. Now measure what is left
  10. Same-sector RPs share a sub on purpose
  11. Validate the sector document at registration (and measure what skipping it costs)
  12. The secret is load-bearing: rotate it, then leak it
  13. Honest negatives: what pairwise does not stop
  14. How a pro deploys this

Open the full interactive lab →