Work on this exercise locally

This web app is a reference guide — you can read instructions, browse starter code, and view tests here. To actually complete the exercise, you need to work in your local development environment.

1Clone the repo: git clone https://github.com/weihaoqu/program-analysis-bootcamp-student
2Edit the starter file in your editor (VS Code, Vim, etc.) — replace failwith "TODO" with your implementation.
3Run the tests: dune runtest modules/module5-security-analysis/exercises/taint-lattice

Taint Lattice

The taint lattice

Taint analysis tracks whether data may carry untrusted user input. The lattice has four elements:

        Top              "may be tainted or untainted -- no info"
       / \
  Tainted  Untainted     "definitely tainted / definitely clean"
       \ /
        Bot              "unreachable"

Key properties:

  • Bot is below everything (identity for join)
  • Top is above everything (identity for meet)
  • Tainted and Untainted are incomparable -- their join is Top, their meet is Bot
  • This is a finite lattice, so widen = join (no infinite chains)