Skip to content
BENIBIX Learn

Data Flow Analysis

Development🕸️ Code IntelligenceCode Analysis

Also known as Dataflow Analysis, Taint Analysis, Taint Tracking

Following a value through a program. You see where it starts and where it ends.

Think of it like

It is like dropping dye in a river. Then you watch where the colour goes.

Example

A scanner follows the search box text in Emma's app. It finds a path where the text reaches an SQL query with no checks.

Why it matters

Many bugs are a value in the wrong place: empty, unchecked or leaked. This finds those paths.

Definition

Data flow analysis follows a value through a program, from where it is made to where it is used. It walks the control flow graph and tracks each variable on every path. It can tell if a value might be empty when it is used. A common use follows user input, called taint, to see if it reaches a database query unchecked. That is how many tools find injection bugs.
The dotted line on the right follows one value from where it is set.

Common mistake

Thinking a clean scan means safe code. Data that flows through a file, a queue or another service is often lost from view.

Key takeaways

  1. 1
    Track values. From where set to where used.
  2. 2
    Every path. It walks each branch.
  3. 3
    Follow the taint. User input must be checked.