Lion Cipher Lab

Certificate-bound access tokens (RFC 8705): make a stolen token useless without the client's TLS certificate

Why it matters

A normal OAuth 2.0 access token is a BEARER token, and 'bearer' is the whole risk: like a paper banknote, it is valid for whoever holds it, no questions asked. Copy that token out of a log line, a proxy dump, a crash report, or an SSRF response and the attacker replays it and IS the client until it expires. Short lifetimes shrink that window but never close it. The professional fix is to stop making tokens spendable by anyone who holds them — to SENDER-CONSTRAIN them, binding each token to a secret the legitimate client owns so that merely possessing the token is not enough. RFC 8705 does…

What you'll learn

Steps in this lab

  1. The words first: bearer vs sender-constrained, and RFC 8705's two mechanisms
  2. Make the project and install the one dependency (jose)
  3. Mint a local CA and certificates, and compute a thumbprint by hand
  4. Build the token issuer (HTTPS server that binds the token to the presented cert)
  5. Build the resource server (verify the token AND the presented certificate)
  6. Prove it: legit client gets 200, a stolen token replayed from another cert gets 401
  7. The judgment: mTLS-bound here, DPoP there, and the failure modes that bite

Open the full interactive lab →