Files
codeql/csharp/ql/test/library-tests/frameworks/JsonNET/Json.ql
2019-02-08 14:37:54 +00:00

19 lines
552 B
Plaintext

import csharp
import semmle.code.csharp.dataflow.TaintTracking
class Configuration extends TaintTracking::Configuration {
Configuration() { this = "Json.NET test" }
override predicate isSource(DataFlow::Node src) {
src.asExpr().(StringLiteral).getValue() = "tainted"
}
override predicate isSink(DataFlow::Node sink) {
exists(MethodCall c | c.getArgument(0) = sink.asExpr() and c.getTarget().getName() = "Sink")
}
}
from Configuration c, DataFlow::Node source, DataFlow::Node sink
where c.hasFlow(source, sink)
select source, sink