mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
move the MaD sql-injection sink to SqlInjectionCustomizations.qll
This commit is contained in:
@@ -372,14 +372,6 @@ module SqlExecution {
|
|||||||
/** Gets the argument that specifies the SQL statements to be executed. */
|
/** Gets the argument that specifies the SQL statements to be executed. */
|
||||||
abstract DataFlow::Node getSql();
|
abstract DataFlow::Node getSql();
|
||||||
}
|
}
|
||||||
|
|
||||||
private import semmle.python.frameworks.data.ModelsAsData
|
|
||||||
|
|
||||||
private class DataAsSqlExecution extends Range {
|
|
||||||
DataAsSqlExecution() { this = ModelOutput::getASinkNode("sql-injection").getARhs() }
|
|
||||||
|
|
||||||
override DataFlow::Node getSql() { result = this }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -60,4 +60,11 @@ module SqlInjection {
|
|||||||
* A comparison with a constant string, considered as a sanitizer-guard.
|
* A comparison with a constant string, considered as a sanitizer-guard.
|
||||||
*/
|
*/
|
||||||
class StringConstCompareAsSanitizerGuard extends SanitizerGuard, StringConstCompare { }
|
class StringConstCompareAsSanitizerGuard extends SanitizerGuard, StringConstCompare { }
|
||||||
|
|
||||||
|
private import semmle.python.frameworks.data.ModelsAsData
|
||||||
|
|
||||||
|
/** A sink for sql-injection from model data. */
|
||||||
|
private class DataAsSqlSink extends Sink {
|
||||||
|
DataAsSqlSink() { this = ModelOutput::getASinkNode("sql-injection").getARhs() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user