Skip to content

Commit a812d4d

Browse files
committed
move the MaD sql-injection sink to SqlInjectionCustomizations.qll
1 parent 571fc3e commit a812d4d

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

python/ql/lib/semmle/python/Concepts.qll

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,6 @@ module SqlExecution {
372372
/** Gets the argument that specifies the SQL statements to be executed. */
373373
abstract DataFlow::Node getSql();
374374
}
375-
376-
private import semmle.python.frameworks.data.ModelsAsData
377-
378-
private class DataAsSqlExecution extends Range {
379-
DataAsSqlExecution() { this = ModelOutput::getASinkNode("sql-injection").getARhs() }
380-
381-
override DataFlow::Node getSql() { result = this }
382-
}
383375
}
384376

385377
/**

python/ql/lib/semmle/python/security/dataflow/SqlInjectionCustomizations.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,11 @@ module SqlInjection {
6060
* A comparison with a constant string, considered as a sanitizer-guard.
6161
*/
6262
class StringConstCompareAsSanitizerGuard extends SanitizerGuard, StringConstCompare { }
63+
64+
private import semmle.python.frameworks.data.ModelsAsData
65+
66+
/** A sink for sql-injection from model data. */
67+
private class DataAsSqlSink extends Sink {
68+
DataAsSqlSink() { this = ModelOutput::getASinkNode("sql-injection").getARhs() }
69+
}
6370
}

0 commit comments

Comments
 (0)