Course contentsShow
← Security
Lesson 1381 of 3,05228. Application Security - TestingFree lesson

Data Flow Analysis and Taint Tracking

Tracking user input through the application to identify where untrusted data reaches sensitive sinks.

Data Flow Analysis and Taint Tracking

What You'll Learn

You'll learn how security tools track user input through your application to detect when untrusted data reaches dangerous operations without proper validation.

The Core Idea

Think of taint tracking like following a drop of dye through a water system. When untrusted data enters your application (from HTTP requests, file uploads, or API calls), it gets marked as "tainted." The security tool then follows this data through every assignment, function call, and transformation to see where it flows.

If tainted data reaches a sensitive sink—like a database query, system command, or file operation—without passing through a sanitization function, you've found a potential vulnerability.

How It Works in Practice

Taint tracking operates in phases:

  1. Sources: Identify where untrusted data enters (user input, external APIs)
  2. Propagation: Track how data flows through variables, function parameters, and return values
  3. Sinks: Monitor sensitive operations that could be exploited
  4. Sanitizers: Recognize functions that clean or validate data

For example, if userInput flows into executeQuery(userInput) without sanitization, that's a SQL injection risk. But if it passes through sanitize(userInput) first, the taint is removed.

Why This Matters for IAST

IAST tools (which you learned about recently) use runtime instrumentation to perform taint tracking with actual execution data. Unlike SAST's static guesses, IAST sees the real paths data takes through your running application, reducing false positives and catching vulnerabilities that only appear at runtime.

Key Takeaway: Data flow analysis and taint tracking form the foundation of modern security testing—by following untrusted data from entry points to dangerous operations, tools can automatically identify injection vulnerabilities and other input-handling flaws with high accuracy.