Lion Cipher Lab

Find and fix business-logic flaws in a checkout (the bugs no scanner flags)

Why it matters

Most of the security tools you will meet look for broken input: a quote that breaks a SQL query, a script tag, a string where a number should be. Business-logic flaws have no broken input. A quantity of -400 is a valid number. A price of 1.00 is a valid price. Confirming an order is a valid request. The bug is that the application lets these well-formed requests do something the business never meant to allow, like selling a laptop for a dollar or shipping goods nobody paid for. Scanners and schema validators cannot find this, because they do not know what your shop is for. Only a person who…

What you'll learn

Steps in this lab

  1. What a business-logic flaw is, and why a scanner walks past it
  2. Build the vulnerable checkout (shop_vuln.py)
  3. Write the validator a generic tool would give you (schema_check.py)
  4. Write the abuse-case suite (abuse_suite.py)
  5. Measure BEFORE: 7 of 7 abuses work and the validator flags 0 of 39
  6. Fix it by putting the rules on the server (shop_fixed.py)
  7. Measure AFTER: 0 of 7 abuses work and 3 of 3 honest orders still pass
  8. The honest negative: an abuse nobody encoded still gets through
  9. When to reach for this, and how a pro does it better

Open the full interactive lab →