mirror of
https://github.com/github/codeql.git
synced 2026-07-27 14:01:57 +02:00
39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
/**
|
|
* Provides a taint-tracking configuration for detecting "SQL injection" vulnerabilities.
|
|
*
|
|
* Note, for performance reasons: only import this file if
|
|
* `SqlInjection::Configuration` is needed, otherwise
|
|
* `SqlInjectionCustomizations` should be imported instead.
|
|
*/
|
|
|
|
private import python
|
|
import semmle.python.dataflow.new.DataFlow
|
|
import semmle.python.dataflow.new.TaintTracking
|
|
import SqlInjectionCustomizations::SqlInjection
|
|
|
|
/**
|
|
* DEPRECATED: Use `SqlInjectionFlow` module instead.
|
|
*
|
|
* A taint-tracking configuration for detecting "SQL injection" vulnerabilities.
|
|
*/
|
|
deprecated class Configuration extends TaintTracking::Configuration {
|
|
Configuration() { this = "SqlInjection" }
|
|
|
|
override predicate isSource(DataFlow::Node source) { source instanceof Source }
|
|
|
|
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
|
|
|
|
override predicate isSanitizer(DataFlow::Node node) { node instanceof Sanitizer }
|
|
}
|
|
|
|
private module SqlInjectionConfig implements DataFlow::ConfigSig {
|
|
predicate isSource(DataFlow::Node source) { source instanceof Source }
|
|
|
|
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
|
|
|
|
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
|
|
}
|
|
|
|
/** Global taint-tracking for detecting "SQL injection" vulnerabilities. */
|
|
module SqlInjectionFlow = TaintTracking::Global<SqlInjectionConfig>;
|