Lion Cipher Lab

Defend against OAuth 2.0 device-code phishing — simulate the attack, then shut it down

Why it matters

Device-code phishing has become one of the cleanest ways to take over an account without ever touching a password, and defenders keep missing it because it does not look like an attack. Every control people trust -- 'we have MFA,' 'we block credential phishing,' 'we scan for fake login pages' -- is bypassed, because the victim signs in at the REAL identity provider, completes real MFA, and clicks a real approve button. The only thing the attacker supplied was a short code and a good story ('IT here, please approve this device enrolment'). The tokens that come out are genuine. This matters to…

What you'll learn

Steps in this lab

  1. First, the shape of the problem — a legitimate flow, abused
  2. Set up: build a tiny RFC 8628 authorization server, offline
  3. Meet the legitimate flow (30 seconds, so the abuse is obvious)
  4. BEFORE — run the phish and get a token (success count = 1)
  5. Why it worked — and why there is nothing to 'patch'
  6. HARDEN #1 — an informative consent screen (victim declines)
  7. HARDEN #2 — a short user_code lifetime (window closes)
  8. HARDEN #3 — rate-limit the polling (slow_down)
  9. HARDEN #4 — the fix that holds: deny the grant to accounts that don't need it
  10. Honest limits, and how a pro thinks about it

Open the full interactive lab →