Lion Cipher Lab

Exploit and fix an open redirect (in your own lab)

Why it matters

An open redirect is one of the most underestimated web bugs, because on its own it looks harmless: the app just sends the browser somewhere else. The danger is WHERE. Many sites carry a 'come back here after you finish' value in the URL — a ?next=, ?url=, ?returnTo=, or ?redirect= parameter used after login, logout, or a payment. If the server copies that value into the redirect without checking it, an ATTACKER gets to choose the destination. Now they craft a link that begins with your real, trusted domain — the part a cautious user actually checks — but whose parameter points at a site they…

What you'll learn

Steps in this lab

  1. The vocabulary: a redirect, the Location header, and what 'open' means
  2. Set up: confirm Node, make a folder
  3. Build the VULNERABLE app (it redirects to whatever 'next' says)
  4. Exploit it (1): the phishing bounce — a trusted-looking link that lands on evil.example
  5. Exploit it (2): the OAuth redirect_uri chain — how a redirect becomes token theft
  6. Why the tempting fixes fail — feel the bypasses yourself
  7. Fix it three ways — allowlist, relative-only, and (best) indirection
  8. What you did — and the reflex to keep

Open the full interactive lab →