How does a SAST tool find a SQL injection using taint analysis?
AdvancedConceptApplication Security Testing (SAST, DAST, SCA, Secrets)
Answer
The engine defines sources (untrusted input such as request.args), sinks (dangerous functions such as cursor.execute) and sanitizers (functions that neutralise taint). It builds a data-flow graph and reports a finding when a path exists from a source to a sink without passing through a sanitizer.
CodeQL models this as queries over a code database; Semgrep taint mode uses pattern-sources, pattern-sinks and pattern-sanitizers. Accuracy depends on how well the tool models frameworks and inter-procedural flows.
More on Application Security Testing (SAST, DAST, SCA, Secrets)
What is SAST and what are its strengths and limits?BeginnerWhat is DAST and how does it differ from SAST?BeginnerWhat is IAST and RASP?IntermediateWhat is SCA and what does it scan?BeginnerHow do you write a simple Semgrep rule?IntermediateWhat is CodeQL and how does its model differ from Semgrep?Intermediate