Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is SAST?

Static Application Security Testing analyses source code without running it, tracing how untrusted data reaches dangerous operations and flagging unsafe patterns.

Illustration for the cybersecurity term SAST
Home / Blog / Cybersecurity Terms / What Is SAST?
17 November 2026

What Is SAST?

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.

Taint Analysis

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.

What It Finds Well, and Badly

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:

The False Positive Problem

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.

Tools and Output Formats

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.

Where It Sits in Practice

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.

FAQ – Frequently Asked Questions

Why Does SAST Report So Many False Positives?

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.

When Should SAST Run in the Pipeline?

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.

Can SAST Find Vulnerabilities in Our Dependencies?

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.

Should the Build Fail on a SAST Finding?

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.

Related Terms

You May Be Interested In These

What Is Security by Design?

Cybersecurity Terms

17 November 2026

What Is Security by Design?

Read More
What Are Sigma Rules?

Cybersecurity Terms

17 November 2026

What Are Sigma Rules?

Read More
What Is Sigstore?

Cybersecurity Terms

17 November 2026

What Is Sigstore?

Read More