← Back to section · Software & Developer Tools
What SAST Can and Cannot Do: The Capabilities and Limits of Static Analysis
Static application security testing reviews source code without running the program. It systematically catches patterned defects such as injection, dangerous functions, and cryptographic misuse, but it is bounded by false positives, path explosion, and the absence of runtime semantics. This article explains how SAST works, which defect classes it handles well, and how to place it inside a complete testing portfolio.
Static application security testing (SAST) is one of the earliest security testing techniques to enter the development process: it never runs the program, instead reading source code, bytecode, or intermediate representations to look for patterns that may lead to vulnerabilities. For cryptographic software SAST carries an extra layer of value — many cryptographic misuses (weak randomness, hard-coded keys, retired algorithms and modes) are themselves patterned and leave clear textual and call-site signatures in code. This article reviews how SAST works, the problems it can find reliably, its structural blind spots, and the engineering practices that make it genuinely useful.
How It Works: From Code to Data-Flow Models
A SAST tool typically parses source code into an abstract syntax tree, then builds control-flow and data-flow graphs on top of it, and performs two kinds of analysis. The first is pattern matching: looking for calls to dangerous functions (such as unsafe string copies or banned hash algorithms) and risky configuration idioms (disabled certificate verification, leftover debug switches). The second goes deeper and is called taint analysis: external input is marked as a taint source, sensitive operations (SQL concatenation, command execution, key derivation) are marked as sinks, and the tool tracks whether taint reaches a sink without sanitisation. Taint analysis can find injection problems that span functions and files, and it is the core capability that separates modern SAST from simple text search. Heavier techniques such as symbolic execution and abstract interpretation use constraint solving or value-range reasoning to judge whether a dangerous path is actually reachable, which reduces false positives at the cost of significantly more analysis time and resources.
What It Is Good at Finding
SAST is strongest on problems that have stable signatures in code. Injection defects (SQL injection, command injection, path traversal) present clear taint paths and are taint analysis’s home ground. Cryptographic misuse is another major class: MD5 or SHA-1 used for security purposes, ECB mode, fixed IVs, keys hard-coded into source, predictable random sources generating tokens — all of these have explicit API and constant signatures that rule sets cover easily. For buffer and memory safety, static analysis can flag copies without length checks, integer-overflow risk points, and use-after-free patterns. SAST also checks coding-standard-level security requirements, such as sensitive data written to logs or stack details leaked through exception handling. Its biggest process advantage is earliness: code can be scanned as soon as it is committed, with no runnable environment required, which makes it a natural fit for CI gating.
Structural Blind Spots: False Positives, False Negatives, Missing Semantics
SAST’s limitations follow from its premise — it sees code, not execution. First, false positives: to avoid missing issues, static analysis tends to report paths that are merely possibly reachable, so many alerts correspond to paths that are infeasible in real runs; without triage capacity, teams quickly learn to ignore the alerts wholesale. Second, false negatives: reflection, dynamic loading, and implicit framework calls break the data-flow graph and taint tracking stops there; analysis depth is limited by timeouts and path explosion, and on complex programs tools deliberately abandon some paths. Third, semantic blind spots: business-logic defects (broken authorisation, the business consequences of race conditions, billing bypasses) follow no generic pattern, and SAST is largely powerless against them. Fourth, authentication configuration, deployment parameters, and the versions of third-party components loaded at runtime all live outside the code, and outside its view — precisely the territory of dependency auditing and dynamic testing.
Keeping SAST Running: Rule Governance and Metrics
SAST programmes usually fail not because the tool is weak but because nobody governs it. The rule set needs an owner: when new frameworks and APIs arrive, rules are added promptly; rules with persistently zero findings are reviewed to determine whether the code is genuinely clean or the rule has silently stopped working. Alert data should feed metrics: track findings and confirmation rates by defect class, tune the classes whose false-positive rate stays high, and schedule manual deep review for modules whose confirmed-defect density is abnormal. Coverage of the scanning itself also needs watching — are all repositories, languages, and branches included, and does the incremental baseline drift with the main branch? Without this operational work, SAST easily decays within three months of launch into an unattended machine that produces only noise. Teams that govern it well, by contrast, keep confirmed-alert handling times within days, and SAST becomes a tool developers willingly glance at when committing code rather than a gate they route around.
The Right Place: One Layer of a Portfolio, Not a Silver Bullet
Using SAST well is mostly about positioning and supporting process. At the rule level, trim the rule set to the languages and frameworks the project actually uses, disable rules irrelevant to the codebase, and enable a high-strength cryptographic-misuse rule set specifically for crypto modules. At the process level, apply incremental scanning and baseline management to new code: register existing alerts as a baseline, gate only on new findings, and avoid drowning the team in historical debt; alerts need owners who triage, grade, and track fixes, and confirmed false positives should be written back as suppression rules so noise falls over time. At the portfolio level, SAST answers “is it written correctly”, fuzzing answers “does it survive malformed input”, dependency auditing answers “do the components carry known vulnerabilities”, and dynamic testing answers “how does it behave once running” — the four complement each other, and no single tool can substitute for the rest. In the end, SAST is an efficient pattern radar: it drives the cost of finding patterned defects to a minimum, but judging whether a piece of code is truly secure still requires people who understand the semantics, and dynamic evidence. For a team just starting out, the pragmatic path is to run it in CI in report-only mode first, spend an iteration or two learning its own false-positive baseline and most frequent defect classes, and only then progressively enable gating and the cryptographic rule sets — credibility first, constraint second; reversing the order is a common reason SAST programmes die young.
Tags: SASTStatic AnalysisCode Audit