Lion Cipher Lab

Write custom Semgrep taint rules and gate CI (advanced SAST)

Why it matters

Registry rules catch known-insecure PATTERNS on a single line. The bugs that ship past them are usually about FLOW: untrusted input that travels through several variables and function calls before it reaches a dangerous sink like os.system or a raw SQL execute. A naive pattern match ("flag os.system(...)") either misses the bug when the input arrives through a variable, or drowns you in false positives on hardcoded, safe calls. Taint analysis — modeling data as it flows from a SOURCE (user input) to a SINK (the dangerous call), and treating it as safe once it passes a SANITIZER — is how you…

What you'll learn

Steps in this lab

  1. The idea: taint (dataflow) vs a single-pattern match
  2. Set up and write a deliberately-vulnerable app
  3. Author the custom taint rule (mode: taint)
  4. Run it and confirm the true positive fires
  5. Prove the sanitizer works: the safe path does NOT fire
  6. Tune for false positives
  7. Gate CI: fail the build on a tainted flow
  8. The judgment: when to fail the build, and honest limits

Open the full interactive lab →