mirror of
https://github.com/hohn/codeql-dataflow-sql-injection.git
synced 2025-12-15 17:53:04 +01:00
from...where...select with class
This commit is contained in:
committed by
=Michael Hohn
parent
e6b23a9d86
commit
01048300c0
@@ -93,7 +93,7 @@ int main(int argc, char* argv[]) {
|
||||
info = get_user_info();
|
||||
id = get_new_id();
|
||||
write_info(id, info);
|
||||
free(info);
|
||||
free(info);
|
||||
/*
|
||||
* show_info(id);
|
||||
*/
|
||||
|
||||
15
session.ql
15
session.ql
@@ -1,4 +1,3 @@
|
||||
|
||||
import cpp
|
||||
|
||||
// 1. invalid input -- source
|
||||
@@ -9,14 +8,22 @@ import cpp
|
||||
//
|
||||
// 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
|
||||
where
|
||||
read.getTarget().getName() = "read" and
|
||||
read.getArgument(1) = buf
|
||||
select buf
|
||||
|
||||
Reference in New Issue
Block a user