Files
codeql-lab/codeql-dataflow-sql-injection-c/Explore.ql
2025-08-06 15:56:48 -07:00

16 lines
400 B
Plaintext

/**
* @name SQLI Vulnerability
* @description Using untrusted strings in a sql query allows sql injection attacks.
* @ kind path-problem
* @id cpp/sqlivulnerable
* @problem.severity warning
*/
import cpp
// import semmle.code.cpp.dataflow.new.TaintTracking
from FunctionCall exec
where exec.getTarget().getName().matches("%snprintf%")
select exec, exec.getTarget().getName(), exec.getAnArgument()