mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
24 lines
785 B
Plaintext
24 lines
785 B
Plaintext
import csharp
|
|
import semmle.code.csharp.dataflow.internal.ContentDataFlow as ContentDataFlow
|
|
|
|
module ContentConfig implements ContentDataFlow::ConfigSig {
|
|
predicate isSource(DataFlow::Node src) { src.asExpr() instanceof ObjectCreation }
|
|
|
|
predicate isSink(DataFlow::Node sink) {
|
|
exists(MethodCall mc |
|
|
mc.getTarget().hasUndecoratedName("Sink") and
|
|
mc.getAnArgument() = sink.asExpr()
|
|
)
|
|
}
|
|
|
|
int accessPathLimit() { result = 2 }
|
|
}
|
|
|
|
module ContentFlow = ContentDataFlow::Global<ContentConfig>;
|
|
|
|
from
|
|
DataFlow::Node source, ContentFlow::AccessPath sourceAp, DataFlow::Node sink,
|
|
ContentFlow::AccessPath sinkAp, boolean preservesValue
|
|
where ContentFlow::flow(source, sourceAp, sink, sinkAp, preservesValue)
|
|
select source, sourceAp, sink, sinkAp, preservesValue
|