mirror of
https://github.com/hohn/codeql-lab.git
synced 2025-12-16 18:03:08 +01:00
Rename directories to include language. Also update files
This commit is contained in:
committed by
=Michael Hohn
parent
fe1baf7dc1
commit
102c18cce5
29
codeql-dataflow-sql-injection-c/session.ql
Normal file
29
codeql-dataflow-sql-injection-c/session.ql
Normal file
@@ -0,0 +1,29 @@
|
||||
import cpp
|
||||
|
||||
// 1. invalid input -- source
|
||||
// count = read(STDIN_FILENO, buf, BUFSIZE - 1);
|
||||
//
|
||||
// 2. gets to a sql statement -- flow
|
||||
// flow config
|
||||
//
|
||||
// 3. drops table -- sink
|
||||
// rc = sqlite3_exec(db, query, NULL, 0, &zErrMsg);
|
||||
// All predicates and classes are using one of:
|
||||
// AST Abstract syntax tree
|
||||
// CFG Control flow graph
|
||||
// DFG Data flow graph
|
||||
// Type hierarchy
|
||||
class DataSource extends VariableAccess {
|
||||
DataSource() {
|
||||
exists(FunctionCall read |
|
||||
read.getTarget().getName() = "read" and
|
||||
read.getArgument(1) = this
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
from FunctionCall read, VariableAccess buf
|
||||
where
|
||||
read.getTarget().getName() = "read" and
|
||||
read.getArgument(1) = buf
|
||||
select buf
|
||||
Reference in New Issue
Block a user