mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Merge pull request #20074 from d10c/d10c/diff-informed-phase-3-csharp
C#: Diff-informed queries: phase 3 (non-trivial locations)
This commit is contained in:
@@ -39,6 +39,15 @@ private module ConditionalBypassConfig implements DataFlow::ConfigSig {
|
|||||||
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
|
||||||
|
|
||||||
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
|
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
|
||||||
|
|
||||||
|
predicate observeDiffInformedIncrementalMode() { any() }
|
||||||
|
|
||||||
|
Location getASelectedSinkLocation(DataFlow::Node sink) {
|
||||||
|
result = sink.getLocation()
|
||||||
|
or
|
||||||
|
// from ConditionalBypass.ql
|
||||||
|
result = sink.(Sink).getSensitiveMethodCall().getLocation()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ private module TaintToObjectMethodTrackingConfig implements DataFlow::ConfigSig
|
|||||||
predicate isSink(DataFlow::Node sink) { sink instanceof InstanceMethodSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof InstanceMethodSink }
|
||||||
|
|
||||||
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
|
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
|
||||||
|
|
||||||
|
predicate observeDiffInformedIncrementalMode() {
|
||||||
|
any() // used in one of the disjuncts in UnsafeDeserializationUntrustedInput.ql
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,6 +81,10 @@ private module JsonConvertTrackingConfig implements DataFlow::ConfigSig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
|
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
|
||||||
|
|
||||||
|
predicate observeDiffInformedIncrementalMode() {
|
||||||
|
any() // used in one of the disjuncts in UnsafeDeserializationUntrustedInput.ql
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,6 +141,10 @@ private module TypeNameTrackingConfig implements DataFlow::ConfigSig {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
predicate observeDiffInformedIncrementalMode() {
|
||||||
|
none() // Only used as secondary config in UnsafeDeserializationUntrustedInput.ql
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -149,6 +161,10 @@ private module TaintToConstructorOrStaticMethodTrackingConfig implements DataFlo
|
|||||||
predicate isSink(DataFlow::Node sink) { sink instanceof ConstructorOrStaticMethodSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof ConstructorOrStaticMethodSink }
|
||||||
|
|
||||||
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
|
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
|
||||||
|
|
||||||
|
predicate observeDiffInformedIncrementalMode() {
|
||||||
|
any() // used in one of the disjuncts in UnsafeDeserializationUntrustedInput.ql
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,6 +202,10 @@ private module TaintToObjectTypeTrackingConfig implements DataFlow::ConfigSig {
|
|||||||
oc.getObjectType() instanceof StrongTypeDeserializer
|
oc.getObjectType() instanceof StrongTypeDeserializer
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
predicate observeDiffInformedIncrementalMode() {
|
||||||
|
none() // only used as secondary config in UnsafeDeserializationUntrustedInput.ql
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -210,6 +230,10 @@ private module WeakTypeCreationToUsageTrackingConfig implements DataFlow::Config
|
|||||||
sink.asExpr() = mc.getQualifier()
|
sink.asExpr() = mc.getQualifier()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
predicate observeDiffInformedIncrementalMode() {
|
||||||
|
none() // only used as secondary config in UnsafeDeserializationUntrustedInput.ql
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ module NotThreadSafeCryptoUsageIntoParallelInvokeConfig implements DataFlow::Con
|
|||||||
}
|
}
|
||||||
|
|
||||||
predicate isSink(DataFlow::Node sink) { sink instanceof ParallelSink }
|
predicate isSink(DataFlow::Node sink) { sink instanceof ParallelSink }
|
||||||
|
|
||||||
|
predicate observeDiffInformedIncrementalMode() { any() }
|
||||||
}
|
}
|
||||||
|
|
||||||
module NotThreadSafeCryptoUsageIntoParallelInvoke =
|
module NotThreadSafeCryptoUsageIntoParallelInvoke =
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ module ConnectionStringConfig implements DataFlow::ConfigSig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
predicate isBarrier(DataFlow::Node node) { node instanceof StringFormatSanitizer }
|
predicate isBarrier(DataFlow::Node node) { node instanceof StringFormatSanitizer }
|
||||||
|
|
||||||
|
predicate observeDiffInformedIncrementalMode() { any() }
|
||||||
|
|
||||||
|
Location getASelectedSinkLocation(DataFlow::Node sink) {
|
||||||
|
any(Call call | call.getAnArgument() = sink.asExpr()).getLocation() = result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user