Skip to content
Offensive Security Glossary / Static Application Security Testing (SAST)

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)

Static application security testing (SAST) is a white box testing method that analyzes source code, bytecode or binaries without executing them, to find patterns and data flows that indicate security vulnerabilities, such as untrusted input reaching a SQL query or a shell command.

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

StrengthsLimits
Runs early and fast, no deployment neededFalse positives when sanitization or reachability is not understood
Exact location of the flawBlind to runtime configuration, infrastructure and third-party services
Covers code paths that are hard to reach dynamicallyWeak on authorization and business logic, which are about intent
Maps findings to CWELanguage and framework support varies by tool
  • 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

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

Reviewed against the primary sources cited on this page. Verified 2026-12-02.

Confirm What Reaches Production

Run a free AI pentest against your running apps and APIs.

Free AI Pen Test

No credit card. Findings include reproducible steps and exploit code.

Firecompass ranked #1 AI on HackerOne. Read more →