Lion Cipher Lab

Exploit and fix CSV formula injection (spreadsheet formula injection) in your own app

Why it matters

CSV formula injection is one of the most under-taught web bugs precisely because it breaks the mental model everyone brings to injection. Almost every application collects data from users — feedback, contact-form messages, support tickets, a display name — and almost every application lets a staff member EXPORT that data to a spreadsheet later. The developer writes each user's text into a cell and thinks the job is done, because on the server that text is inert: it is just stored and copied, and no server-side code runs. But a spreadsheet is an interpreter. When Excel, LibreOffice Calc, or…

What you'll learn

Steps in this lab

  1. What a CSV, a spreadsheet formula, and the trigger characters actually are
  2. Set up: confirm Python, make a folder (no installs at all)
  3. Build the VULNERABLE app: accept a field, store it, export it raw
  4. Exploit: submit =1+1, export, and inspect the RAW cell (before measurement)
  5. The real payloads: HYPERLINK / WEBSERVICE exfil and the historical DDE RCE
  6. Fix it: neutralize formula triggers on export (after measurement)
  7. Honest negatives: it's a consumer-side bug, and the fix has sharp edges
  8. Do it better: output-context-aware encoding and the injection family

Open the full interactive lab →