SSOGEN / Learn / SAST vs DAST vs IAST: One Bug, Three Kinds of Evidence
Learn
SAST vs DAST vs IAST: One Bug, Three Kinds of Evidence
Where the tool looks separates SAST vs DAST: static testing reads the code without running it, dynamic testing sends requests to the running application, and IAST watches from inside it while tests run.

The SAST vs DAST choice comes down to evidence. Each method reports different proof for the same flaw, so each catches bugs the others miss.
- SAST (static application security testing) reports a file and a line, read from source code, bytecode or binaries.
- DAST (dynamic application security testing) reports a URL, a parameter and the response that gave the flaw away.
- IAST (interactive application security testing) reports the request and the code path, for code that tests actually run.
OWASP’s injection guidance in the Top 10:2025 names all three as tools to add to the CI/CD pipeline.
A 16-line Flask app with a CWE-89 flaw, scanned three ways
We wrote a 16-line Flask app with one route, GET /orders?customer=..., that builds its SQL by joining strings. The flaw is CWE-89, SQL injection, filed under A05 Injection in the OWASP Top 10. We ran it locally on November 18, 2026 (Python 3.9.25, Flask 3.1.3, Werkzeug 3.1.8, SQLite 3.34.1) and recorded what each method sees.
customer = request.args.get("customer", "")rows = db().execute("SELECT id, total FROM orders WHERE customer = '" + customer + "'").fetchall()A taint rule follows request.args (the source) into execute() (the sink) and reports CWE-89 at line 15. This is the pattern such rules match, shown without a named tool’s output. No request was sent.
DAST view: five requests to GET /orders
customer value |
Status | Response body |
|---|---|---|
alice |
200 | {"rows":[[1,40.0]]} |
alice' |
500 | Internal Server Error |
x' UNION SELECT 1 -- |
500 | Internal Server Error |
x' UNION SELECT 1, 2 -- |
200 | {"rows":[[1,2]]} |
x' UNION SELECT id, customer FROM orders -- |
200 | {"rows":[[1,"alice"],[2,"bob"],[3,"carol"]]} |
One quote breaks the query (the server log shows sqlite3.OperationalError: unrecognized token). A UNION with one column fails; with two it returns the values the scanner chose. The last request reads every customer name. The scanner knows the parameter, not the line.
customer=alice SELECT id, total FROM orders WHERE customer = 'alice'customer=alice' (no statement: SQLite rejected it before it ran)customer=x' OR '1'='1 SELECT id, total FROM orders WHERE customer = 'x' OR '1'='1'Here a Python sqlite3 trace callback stands in for an IAST sensor: it records every statement the driver runs. A real sensor also tracks the data flow from request.args to execute(), so it can flag the concatenation on the harmless alice request, with no attack sent.
SAST vs DAST: the comparison
Read across a row to see which method answers that question for your pipeline.
| SAST | DAST | IAST | |
|---|---|---|---|
| When it runs | On commit, pull request or build | Against a deployed build, usually staging | While functional tests or a DAST scan run |
| What it needs | Source, bytecode or binaries, and an analyzer for the language | A reachable URL; test credentials for signed-in pages | A sensor library loaded into the application |
| What it reports | File name, line number and code snippet | URL, parameter, request and response | The request and the code path behind it |
| False positives | High: it cannot see countermeasures outside the code it reads | The response is the proof, but it cannot point to the code | Limited to flows the sensor saw at run time |
| Language dependence | One analyzer per language and framework | None: it talks HTTP | The sensor must exist for the runtime |
| Pipeline stage | IDE, pull request, CI | Staging or pre-release | CI test stage or QA |
| Blind spots | Configuration, authentication and access-control flaws | Pages the crawler never reaches | Code no test executes |
| In the demo | Line 15, CWE-89 | A 500 on one quote; a UNION that returns injected values | The injected clause inside the SQL |
The SAST column follows OWASP’s Source Code Analysis Tools page, which lists “high numbers of false positives” among its weaknesses. Each method has its own page: static analysis in depth and how a DAST scan crawls and attacks. Which findings block a build, and who may waive one, is set per gate in the DevSecOps pipeline.
What is IAST?
IAST places a sensor inside the running application and watches requests travel through the code while tests or a DAST scan exercise it.
- The sensor is a library in the app. OWASP’s DevSecOps Guideline describes sensor modules with access to the code, the data flow and control flow, and back-end connections.
- Traffic decides coverage. A route no test calls produces no finding, however unsafe its code.
- One runtime at a time. A Java sensor does not instrument a Python service; each stack needs its own.
- RASP blocks, it does not test. Runtime application self-protection uses the same instrumentation to detect and stop exploitation in production (NIST SP 800-53 Rev. 5, control SI-7(17)).
After the fix
A parameterized query silences all three methods, and for the right reason.
Before: the input becomes SQL. The value x' OR '1'='1 closes the string, adds a condition and returns all three rows.
After: the input stays data. With WHERE customer = ? and (customer,), the trace shows WHERE customer = 'x'' OR ''1''=''1': one quoted literal that matches nothing.
On the fixed build all five requests return 200, and every injection value returns {"rows":[]}. The SAST rule finds no concatenation, DAST sees no error and no injected rows, and the sensor sees the value bound as a literal.
Questions people ask
Is SonarQube a SAST or DAST tool?
SonarQube is a SAST tool. Sonar describes SonarQube Server as an automated code review and static analysis tool for more than 40 languages. It reads code in the CI pipeline or the IDE and sends no requests to a running application.
Probing a deployed app is the job of a DAST scanner such as ZAP, which OWASP lists among DAST tools.
Which tool is used for SAST analysis?
Any SAST analyzer that supports your languages and frameworks. OWASP’s Source Code Analysis Tools list includes SonarQube and Semgrep, both marked open source or free, and GitHub Advanced Security, which runs CodeQL. OWASP endorses none of them. Compare language coverage, rules for your framework, and how findings reach pull requests before you choose.
What is the difference between a SAST and DAST scan?
A SAST scan reads code without running it and reports a file and line; a DAST scan sends requests to a deployed application and reports a URL and parameter. SAST fits every commit and pull request. DAST needs a running build, usually in staging, and its evidence is the server response, as in the 500 on a single quote above.
Does IAST replace SAST and DAST?
No. IAST reports only on code that tests or a scanner execute, and only in runtimes its sensor supports. SAST still covers paths no test reaches, before anything is deployed. DAST still tests the deployed application from outside, including its server configuration. OWASP’s Top 10:2025 injection guidance names all three as pipeline tools, not alternatives to each other.
What none of the three sees
- Vulnerable libraries. A known flaw in a dependency needs software composition analysis, such as OWASP Dependency-Check, which matches libraries to published CVEs.
- Keys in the repository. A committed API key is valid code to every scanner here; secret scanning looks for it in files and history.
- Business and access-control logic. OWASP lists authentication problems and access control issues as hard for SAST to find. A user who reads another user’s orders through a valid request needs a test written for that rule.
Sources, all read 2026-11-18: OWASP Top 10:2025, A05 Injection, CWE-89, CWE 5.0, OWASP Source Code Analysis Tools, OWASP Vulnerability Scanning Tools, OWASP DevSecOps Guideline, IAST, NIST SP 800-53 Rev. 5, SI-7(17), Python sqlite3, set_trace_callback, SonarQube Server documentation, Semgrep documentation, About CodeQL, ZAP getting started.
Updated