mirror of
https://github.com/hohn/codeql-dataflow-sql-injection-go.git
synced 2025-12-16 02:03:05 +01:00
replace the broken source query with a minimal one
This commit is contained in:
@@ -4,17 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import go
|
import go
|
||||||
|
import DataFlow as DF
|
||||||
|
|
||||||
/** A source expression corresponding to the value returned from getUserInfo. */
|
from DF::CallNode cn
|
||||||
predicate isSource(Expr e) {
|
where cn.getACalleeIncludingExternals().getName() = "ReadString"
|
||||||
exists(Function f, ReturnStmt r, int i |
|
select cn
|
||||||
f.getName() = "getUserInfo" and
|
|
||||||
r.getEnclosingFunction() = f and
|
|
||||||
e = r.getExpr(i)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
from Expr e
|
|
||||||
where isSource(e)
|
|
||||||
select e, "Source: return value of getUserInfo"
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user