Lion Cipher Lab

Analyze a JWT for security flaws

Why it matters

A JWT is the little signed token most modern sites and APIs hand your browser after you log in, and then trust on every request that follows. Because the server trusts whatever a valid token says, the security of a whole application often rests on how carefully that token is verified — and the same handful of mistakes show up again and again: accepting an unsigned 'alg=none' token, signing with a weak secret an attacker can guess, letting an attacker switch the algorithm from RS256 to HS256, forgetting to set an expiry, or stuffing passwords and personal data into a payload that is only…

What you'll learn

Steps in this lab

  1. What a JWT is — and the ground rules
  2. The three parts: header.payload.signature
  3. Generate your OWN test token
  4. Decode it and read the claims — no key required
  5. Flaw 1: the alg=none downgrade
  6. Flaw 2: a weak HMAC secret is guessable
  7. Flaw 3: algorithm confusion (RS256 to HS256) and missing expiry
  8. What you learned — and the defender's checklist

Open the full interactive lab →