Static Application Security Testing
Subject: Computer and Technology noun /ˈstæt.ɪk ˌæp.lɪˈkeɪ.ʃən sɪˈkjʊr.ə.ti ˈtɛs.tɪŋ/ 1 definition
- application-security
- static-analysis
- software-testing
- devsecops
-
Definition (noun)
Entry #331 · UpdatedStatic Application Security Testing (SAST) is a white-box security analysis methodology that inspects an application's source code, bytecode, or compiled binaries to uncover security flaws before the software is executed. Rather than sending live payloads against a running service, a SAST engine parses code into intermediate representations—such as Abstract Syntax Trees (ASTs), control-flow graphs, and call graphs—and applies pattern matching, taint tracking, and dataflow analysis to trace how untrusted inputs propagate to sensitive sinks like SQL queries, OS command executors, or HTML renderers. By integrating directly into IDEs, pre-commit hooks, and CI/CD pipelines, SAST enables engineering teams to catch injection defects, hardcoded secrets, insecure cryptography, and memory hazards early in the software development lifecycle with exact file-and-line diagnostics. Because it evaluates program structure without runtime state, network context, or external environment configurations, SAST can produce false positives on unreachable paths and must be paired with dynamic testing (DAST) and software composition analysis (SCA) to detect runtime misconfigurations and third-party dependency vulnerabilities.
Common Forms
Syntax and AST Pattern Matching: Scans tokenized source or parsed Abstract Syntax Trees against rule signatures to flag localized issues—such as hardcoded credentials, deprecated
MD5orSHA-1hashes, and unsafe calls likeeval()—with low latency inside IDEs.Taint and Dataflow Analysis: Tracks untrusted input from user-controlled sources (such as HTTP parameters or request headers) across functions and modules to verify whether proper sanitization occurs before data reaches sensitive sinks like SQL queries or shell executors.
Control-Flow and Semantic Graph Analysis: Models execution paths, call graphs, and state transitions to detect structural vulnerabilities tied to execution order, including missing authorization checks, use-after-free bugs, unclosed resources, and race conditions.
Bytecode and Binary Static Analysis: Disassembles or lifts compiled artifacts—such as JVM
.jararchives, .NET assemblies, or native ELF and PE binaries—into intermediate representations when source code is unavailable or compiler optimizations affect program behavior.
Example
During a GitHub Actions CI run, a developer opens a pull request containing a Python Flask route that interpolates
request.args.get("username")directly intocursor.execute(f"SELECT * FROM users WHERE name = '{username}'"). Executingsemgrep scan --config p/security-audit --errortraces the tainted HTTP query parameter into the SQL sink without starting the server, flags a CWE-89 SQL injection finding atapp/routes.py:42, and fails the merge check.