Lion Cipher Lab

Defend against the OAuth 2.0 mix-up attack (RFC 9207)

Why it matters

Most OAuth guidance assumes a client talks to exactly one authorization server. Real clients increasingly do not: multi-tenant SaaS, 'log in with the IdP of your choice', and B2B apps that federate to each customer's identity provider all support MANY authorization servers, sometimes ones a customer (or attacker) controls. That is the exact condition the mix-up attack needs. In a mix-up, the attacker's AS interposes in a flow the victim believes is going to a legitimate AS; the victim authenticates at the HONEST AS and a perfectly valid authorization code is minted for them -- but a naive…

What you'll learn

Steps in this lab

  1. The mix-up attack, in plain terms
  2. Why it works: the missing binding between response and AS
  3. Set up your local, authorized, disposable lab
  4. Build the honest authorization server (RFC 9207-compliant)
  5. Build the attacker authorization server (the interposer)
  6. Build the multi-AS client and the victim's browser
  7. Run the mix-up: watch the code leak, then account takeover
  8. The fix: RFC 9207 iss check plus per-AS state binding
  9. The judgment: when it matters, and don't hand-roll it

Open the full interactive lab →