Static Application Security Testing (SAST)
How SAST tools analyze code, where they fit in development, and what they cannot tell you.
What Is Static Application Security Testing (SAST)
SAST shifts detection to the earliest point in development: the developer's editor, the pull request or the build. It can point to the exact file and line. What it cannot do is know how the deployed application is configured, which code paths are reachable from the internet, or whether a flagged flow is actually exploitable.
How SAST Works
- Parsing code into an abstract syntax tree and control-flow graph.
- Pattern rules for dangerous functions and insecure APIs.
- Taint analysis: tracking data from sources (request parameters, headers, files) through the code to sinks (queries, commands, HTML output), and checking whether it passes through a sanitizer.
- Reporting findings with file, line, data-flow trace and CWE.
Strengths and Limits
| Strengths | Limits |
|---|---|
| Runs early and fast, no deployment needed | False positives when sanitization or reachability is not understood |
| Exact location of the flaw | Blind to runtime configuration, infrastructure and third-party services |
| Covers code paths that are hard to reach dynamically | Weak on authorization and business logic, which are about intent |
| Maps findings to CWE | Language and framework support varies by tool |
Related Code-Level Tools
- Software composition analysis (SCA): finds known-vulnerable open source dependencies by version.
- Secret scanning: finds credentials committed to repositories.
- IaC scanning: finds misconfigurations in infrastructure-as-code templates.
SAST in a Testing Program
SAST, DAST and penetration testing answer different questions: is there risky code, does the running app respond insecurely, and can an attacker actually exploit it. Mature programs use SAST to prevent bugs early and penetration testing to confirm what reaches production.
Sources and Standards
- NIST SP 800-218: Secure Software Development Framework (SSDF)
- OWASP: Source Code Analysis Tools
- MITRE CWE
Frequently Asked Questions
What is SAST?
A white box method that analyzes source code, bytecode or binaries without running them to find security vulnerabilities.
Why does SAST produce false positives?
It often cannot fully determine whether data is sanitized along a path or whether the vulnerable code is reachable in the deployed application.
Should I use SAST or DAST?
Both. SAST catches issues early in code; DAST and penetration testing check the running application and confirm exploitability.
Further Reading
- FireCompass web application penetration testing
- Generative AI Pen Testing for Web Applications: What DAST, SAST, and Manual Pen Tests Miss
Related Terms
Confirm What Reaches Production
Run a free AI pentest against your running apps and APIs.
Free AI Pen TestNo credit card. Findings include reproducible steps and exploit code.
