Merge pull request #19661 from d10c/d10c/csharp/diff-informed

C#: mass enable diff-informed data flow
This commit is contained in:
Nora Dimitrijević
2025-06-17 14:52:24 +02:00
committed by GitHub
26 changed files with 52 additions and 0 deletions

View File

@@ -70,6 +70,8 @@ private module SymmetricKeyConfig implements DataFlow::ConfigSig {
/** Holds if the node is a key sanitizer. */
predicate isBarrier(DataFlow::Node sanitizer) { sanitizer instanceof KeySanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -82,6 +82,8 @@ module HardcodedSymmetricEncryptionKey {
succ.asExpr() = mc
)
}
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -32,6 +32,8 @@ private module ClearTextStorageConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -33,6 +33,8 @@ private module CodeInjectionConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -42,6 +42,8 @@ module CommandInjectionConfig implements DataFlow::ConfigSig {
* `node` from the data flow graph.
*/
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -32,6 +32,8 @@ private module ExposureOfPrivateInformationConfig implements DataFlow::ConfigSig
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -45,6 +45,8 @@ module LdapInjectionConfig implements DataFlow::ConfigSig {
* `node` from the data flow graph.
*/
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -35,6 +35,8 @@ private module LogForgingConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -39,6 +39,8 @@ private module MissingXmlValidationConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { exists(sink.(Sink).getReason()) }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -33,6 +33,8 @@ private module ReDoSConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -33,6 +33,8 @@ private module RegexInjectionConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -32,6 +32,8 @@ private module ResourceInjectionConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -43,6 +43,8 @@ module SqlInjectionConfig implements DataFlow::ConfigSig {
* `node` from the data flow graph.
*/
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -35,6 +35,8 @@ private module TaintedPathConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -37,6 +37,8 @@ private module UrlRedirectConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -43,6 +43,8 @@ module XpathInjectionConfig implements DataFlow::ConfigSig {
* `node` from the data flow graph.
*/
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -30,6 +30,8 @@ private module ZipSlipConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -26,6 +26,8 @@ module UnsafeYearCreationFromArithmeticConfig implements DataFlow::ConfigSig {
oc.getObjectType().getABaseType*().hasFullyQualifiedName("System", "DateTime")
)
}
predicate observeDiffInformedIncrementalMode() { any() }
}
module UnsafeYearCreationFromArithmetic =

View File

@@ -45,6 +45,8 @@ module XmlInjectionConfig implements DataFlow::ConfigSig {
mc = node.asExpr()
)
}
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -41,6 +41,8 @@ module AssemblyPathInjectionConfig implements DataFlow::ConfigSig {
name = "UnsafeLoadFrom" and arg = 0
)
}
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -22,6 +22,8 @@ module FormatStringConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) {
sink.asExpr() = any(FormatStringParseCall call).getFormatExpr()
}
predicate observeDiffInformedIncrementalMode() { any() }
}
module FormatString = TaintTracking::Global<FormatStringConfig>;

View File

@@ -41,6 +41,8 @@ module ExposureInTransmittedDataConfig implements DataFlow::ConfigSig {
}
predicate isSink(DataFlow::Node sink) { sink instanceof RemoteFlowSink }
predicate observeDiffInformedIncrementalMode() { any() }
}
module ExposureInTransmittedData = TaintTracking::Global<ExposureInTransmittedDataConfig>;

View File

@@ -59,6 +59,8 @@ module ExceptionInformationExposureConfig implements DataFlow::ConfigSig {
// Do not flow through Message
sanitizer.asExpr().getType().(RefType).getABaseType*() instanceof SystemExceptionClass
}
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -37,6 +37,8 @@ module AddCertToRootStoreConfig implements DataFlow::ConfigSig {
sink.asExpr() = mc.getQualifier()
)
}
predicate observeDiffInformedIncrementalMode() { any() }
}
module AddCertToRootStore = DataFlow::Global<AddCertToRootStoreConfig>;

View File

@@ -40,6 +40,8 @@ module InsecureSqlConnectionConfig implements DataFlow::ConfigSig {
)
)
}
predicate observeDiffInformedIncrementalMode() { any() }
}
/**

View File

@@ -49,6 +49,8 @@ module Random {
// succ = array_or_indexer[pred] - use of random numbers in an index
succ.asExpr().(ElementAccess).getAnIndex() = pred.asExpr()
}
predicate observeDiffInformedIncrementalMode() { any() }
}
/**