mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
19 lines
613 B
Plaintext
19 lines
613 B
Plaintext
import csharp
|
|
import semmle.code.csharp.dataflow.TaintTracking
|
|
|
|
class MyConfiguration extends TaintTracking::Configuration {
|
|
MyConfiguration() { this = "MyConfiguration" }
|
|
|
|
override predicate isSource(DataFlow::Node node) {
|
|
node.asExpr().(StringLiteral).getValue() = "tainted"
|
|
}
|
|
|
|
override predicate isSink(DataFlow::Node node) {
|
|
exists(MethodCall mc | mc.getTarget().hasName("Sink") and node.asExpr() = mc.getArgument(0))
|
|
}
|
|
}
|
|
|
|
from MyConfiguration config, DataFlow::Node source, DataFlow::Node sink
|
|
where config.hasFlow(source, sink)
|
|
select sink, "Data flow from $@.", source, source.toString()
|