Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Static Application Security Testing analyses source code without running it, tracing how untrusted data reaches dangerous operations and flagging unsafe patterns.

What Is SAST?
Static Application Security Testing reads code rather than running it. The tool parses the source into a syntax tree, builds a model of how control and data move through it, and reports places where that model matches a pattern considered dangerous. Because nothing executes, SAST can be applied to a half-finished feature on a developer’s branch, which is the earliest point at which any security tool can say something useful.
The technique that distinguishes a security tool from a style checker is taint tracking. The tool identifies sources, where untrusted data enters, such as an HTTP parameter, a file, or a message queue. It identifies sinks, where data becomes dangerous, such as a SQL string, a shell invocation, or an HTML writer. It then determines whether any path exists from a source to a sink without passing through a recognised sanitiser.
This is harder than it sounds. Reflection, dynamic dispatch, dependency injection, callbacks, and data that leaves through a database and returns later all break the analysis. Tools respond either by assuming the worst, which produces false positives, or by giving up on that path, which produces false negatives. Every product chooses a point on that spectrum, and the choice is why two scanners on the same repository return different findings.
Reliable territory includes injection patterns where a tainted value reaches a query or command, hardcoded credentials and keys, weak or obsolete cryptographic calls, unsafe deserialisation sinks, path handling built from request data, missing output encoding in templates, and disabled certificate validation.
Weak territory is anything requiring knowledge the code does not contain:
A tool reporting several thousand findings on first run is normal and is also how most SAST deployments fail. Developers triage a few dozen, find that most are not exploitable, and stop reading the output. Three practices change that outcome.
Baseline the existing code so only findings introduced by the current change are enforced, and work through the backlog separately on its own schedule. Scan the diff in pull requests rather than the whole repository, which keeps feedback under a few minutes and attaches it to the person who can act on it. And tune the rule set hard, disabling checks that produce nothing but noise in your codebase and writing custom rules for your own unsafe helper functions, which generic rules never know about.
Semgrep and CodeQL dominate the open tooling, the first for readable pattern rules that a developer can write, the second for deep data-flow queries across large codebases. SonarQube covers quality and security together, which suits teams that want one gate. Commercial options such as Checkmarx, Fortify, and Veracode add broader language coverage and compliance reporting. Language-specific tools, including Bandit for Python, gosec for Go, and Brakeman for Ruby on Rails, are fast and often more accurate within their framework.
Most now emit SARIF, a standard JSON format that GitHub, GitLab, and Azure DevOps consume directly, so findings appear as annotations on the pull request rather than in a separate portal. That single integration detail affects adoption more than any accuracy claim in a datasheet.
SAST is the earliest and cheapest of the automated controls, and it is also the one that most needs a human alongside it. A finding is a hypothesis about code that was never executed; confirming it, or recognising that the sanitiser three functions up already handles it, is review work. That is why mature programmes pair automated scanning with periodic secure code review of the areas that matter most, and validate the result with web application security testing against the running system. PCI DSS v4.0 requirement 6.2.3 expects bespoke software to be reviewed before release, by automated tools, by a knowledgeable reviewer, or both, which is the same division of labour written as a control.
Because the tool reasons about code paths it cannot execute. It cannot always tell that a value was validated earlier, that a branch is unreachable, or that a framework sanitises automatically, so it errs towards reporting. Reducing the noise means tuning rules to your codebase, baselining existing findings, and writing custom rules for your own helper functions rather than accepting defaults.
Twice, with different scopes. A fast scan limited to the changed files runs on every pull request, finishing in a few minutes so it does not become an obstacle. A full repository scan runs nightly or weekly, where a longer run time is acceptable and trends can be tracked. Developers see only the first, which is what keeps it useful.
Not well, and it is not the right tool. Library code is usually excluded from analysis, and finding a flaw in a dependency this way is far slower than consulting a vulnerability database. Software composition analysis matches your dependency tree against known advisories, which is the correct control for that question.
On new high-confidence findings, yes; on everything, no. A gate that blocks on the full backlog teaches developers to use the override, after which the gate means nothing. Baseline what exists, enforce on what the current change introduces, and keep a documented exception route with an owner and an expiry date for the genuine special cases.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.