Lion Cipher Lab

Scan an ML model for malicious pickle code (before it runs code on you)

Why it matters

The single most common way to ship a model — a PyTorch .bin/.pt or a scikit-learn .pkl — is Python pickle, and loading a pickle runs whatever code the file's author put in it. Public hubs let anyone upload a model with any name; a poisoned 'llama-2-7b.bin' can steal your cloud credentials the moment a data scientist runs torch.load on it. Knowing how to prove a model is malicious WITHOUT trusting it, and how to move your pipeline onto a format that can't execute, is the difference between a model supply chain you can audit and one you just hope is clean.

What you'll learn

Steps in this lab

  1. The one fact that makes this a security problem
  2. Set up a disposable workspace
  3. Craft a benign 'malicious' model
  4. Watch a naive load execute it
  5. Scan it WITHOUT running it — picklescan
  6. Read the actual opcodes — fickling
  7. Move to a format that can't execute — safetensors
  8. Gate it in CI — and name what still gets past you
  9. Clean up

Open the full interactive lab →