Interview Prep/DevSecOps/Application Security Testing (SAST, DAST, SCA, Secrets)

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.

All DevSecOps questions Roadmap: Security in the pipeline

More on Application Security Testing (SAST, DAST, SCA, Secrets)