Lion Cipher Lab

Exploit and fix mass assignment (privilege escalation via an extra field)

Why it matters

Mass assignment is one of the quietest ways an application hands out admin. There is no memory corruption, no injection, nothing that looks like an attack in a log — just a user updating their profile, with one extra field in the JSON. The reason it is so common is that it comes from a FEATURE: every modern web framework offers a one-liner to take a request body and bind all of its fields onto a database model, because writing out each field by hand is tedious. The moment that model also has a field the user shouldn't control — is_admin, role, account_balance, email_verified, is the classic…

What you'll learn

Steps in this lab

  1. What mass assignment is — the convenience that leaks power
  2. Build the vulnerable app (on your own machine)
  3. Do the honest thing first, and confirm you are NOT admin
  4. Exploit it: one extra field makes you admin
  5. Fix it the right way: an allowlist of bindable fields
  6. Re-run the exact attack and watch it fail
  7. Why allowlist beats blocklist, and where this hides

Open the full interactive lab →