mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
Will need subsequent PRs fixing up test failures (due to deprecated methods moving around), but other than that everything should be straight-forward.
25 lines
873 B
Plaintext
25 lines
873 B
Plaintext
import python
|
|
import semmle.python.dataflow.TaintTracking
|
|
import semmle.python.security.strings.Untrusted
|
|
import semmle.python.security.injection.Command
|
|
|
|
class SimpleSource extends TaintSource {
|
|
SimpleSource() { this.(NameNode).getId() = "TAINTED_STRING" }
|
|
|
|
override predicate isSourceOf(TaintKind kind) { kind instanceof ExternalStringKind }
|
|
|
|
override string toString() { result = "taint source" }
|
|
}
|
|
|
|
class FabricExecuteTestConfiguration extends TaintTracking::Configuration {
|
|
FabricExecuteTestConfiguration() { this = "FabricExecuteTestConfiguration" }
|
|
|
|
override predicate isSource(TaintTracking::Source source) { source instanceof SimpleSource }
|
|
|
|
override predicate isSink(TaintTracking::Sink sink) { sink instanceof CommandSink }
|
|
|
|
override predicate isExtension(TaintTracking::Extension extension) {
|
|
extension instanceof FabricExecuteExtension
|
|
}
|
|
}
|