Lion Cipher Lab

Exploit and fix CSRF (Cross-Site Request Forgery) in your own lab

Why it matters

CSRF — Cross-Site Request Forgery — is the bug where a page you never trusted reaches across the web and makes YOUR browser act as you, on a site you are logged into. It does not steal your password or your session cookie; it simply gets your browser to send a request, and because browsers automatically attach a site's cookie to every request bound for that site, the target cannot tell the forged action from a real one. The classic victims are exactly the actions that matter: transfer money, change the account email, add an admin, delete a repo. For years this was one of the most common…

What you'll learn

Steps in this lab

  1. What CSRF is — and the ground rules
  2. Set up: install Flask, then build the VULNERABLE bank
  3. Log in, make an honest transfer, then fire the CSRF
  4. Fix it: add the three standard defenses
  5. Re-test: confirm the CSRF is dead and the feature still works
  6. The judgment: token vs SameSite vs double-submit — and why SameSite alone is not enough
  7. What you did — and the reflex to keep

Open the full interactive lab →