Skip to content

Commit 79e982a

Browse files
authored
Merge pull request #19661 from d10c/d10c/csharp/diff-informed
C#: mass enable diff-informed data flow
2 parents 84a7975 + f2085c2 commit 79e982a

26 files changed

+52
-0
lines changed

csharp/ql/lib/semmle/code/csharp/security/cryptography/EncryptionKeyDataFlowQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ private module SymmetricKeyConfig implements DataFlow::ConfigSig {
7070

7171
/** Holds if the node is a key sanitizer. */
7272
predicate isBarrier(DataFlow::Node sanitizer) { sanitizer instanceof KeySanitizer }
73+
74+
predicate observeDiffInformedIncrementalMode() { any() }
7375
}
7476

7577
/**

csharp/ql/lib/semmle/code/csharp/security/cryptography/HardcodedSymmetricEncryptionKey.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ module HardcodedSymmetricEncryptionKey {
8282
succ.asExpr() = mc
8383
)
8484
}
85+
86+
predicate observeDiffInformedIncrementalMode() { any() }
8587
}
8688

8789
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/CleartextStorageQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ private module ClearTextStorageConfig implements DataFlow::ConfigSig {
3232
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3333

3434
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
35+
36+
predicate observeDiffInformedIncrementalMode() { any() }
3537
}
3638

3739
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/CodeInjectionQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ private module CodeInjectionConfig implements DataFlow::ConfigSig {
3333
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3434

3535
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
36+
37+
predicate observeDiffInformedIncrementalMode() { any() }
3638
}
3739

3840
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/CommandInjectionQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ module CommandInjectionConfig implements DataFlow::ConfigSig {
4242
* `node` from the data flow graph.
4343
*/
4444
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
45+
46+
predicate observeDiffInformedIncrementalMode() { any() }
4547
}
4648

4749
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/ExposureOfPrivateInformationQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ private module ExposureOfPrivateInformationConfig implements DataFlow::ConfigSig
3232
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3333

3434
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
35+
36+
predicate observeDiffInformedIncrementalMode() { any() }
3537
}
3638

3739
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/LDAPInjectionQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ module LdapInjectionConfig implements DataFlow::ConfigSig {
4545
* `node` from the data flow graph.
4646
*/
4747
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
48+
49+
predicate observeDiffInformedIncrementalMode() { any() }
4850
}
4951

5052
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/LogForgingQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private module LogForgingConfig implements DataFlow::ConfigSig {
3535
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3636

3737
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
38+
39+
predicate observeDiffInformedIncrementalMode() { any() }
3840
}
3941

4042
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/MissingXMLValidationQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ private module MissingXmlValidationConfig implements DataFlow::ConfigSig {
3939
predicate isSink(DataFlow::Node sink) { exists(sink.(Sink).getReason()) }
4040

4141
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
42+
43+
predicate observeDiffInformedIncrementalMode() { any() }
4244
}
4345

4446
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/ReDoSQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ private module ReDoSConfig implements DataFlow::ConfigSig {
3333
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3434

3535
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
36+
37+
predicate observeDiffInformedIncrementalMode() { any() }
3638
}
3739

3840
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/RegexInjectionQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ private module RegexInjectionConfig implements DataFlow::ConfigSig {
3333
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3434

3535
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
36+
37+
predicate observeDiffInformedIncrementalMode() { any() }
3638
}
3739

3840
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/ResourceInjectionQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ private module ResourceInjectionConfig implements DataFlow::ConfigSig {
3232
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3333

3434
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
35+
36+
predicate observeDiffInformedIncrementalMode() { any() }
3537
}
3638

3739
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/SqlInjectionQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ module SqlInjectionConfig implements DataFlow::ConfigSig {
4343
* `node` from the data flow graph.
4444
*/
4545
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
46+
47+
predicate observeDiffInformedIncrementalMode() { any() }
4648
}
4749

4850
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/TaintedPathQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private module TaintedPathConfig implements DataFlow::ConfigSig {
3535
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3636

3737
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
38+
39+
predicate observeDiffInformedIncrementalMode() { any() }
3840
}
3941

4042
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/UrlRedirectQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ private module UrlRedirectConfig implements DataFlow::ConfigSig {
3737
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3838

3939
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
40+
41+
predicate observeDiffInformedIncrementalMode() { any() }
4042
}
4143

4244
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/XPathInjectionQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ module XpathInjectionConfig implements DataFlow::ConfigSig {
4343
* `node` from the data flow graph.
4444
*/
4545
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
46+
47+
predicate observeDiffInformedIncrementalMode() { any() }
4648
}
4749

4850
/**

csharp/ql/lib/semmle/code/csharp/security/dataflow/ZipSlipQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ private module ZipSlipConfig implements DataFlow::ConfigSig {
3030
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3131

3232
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
33+
34+
predicate observeDiffInformedIncrementalMode() { any() }
3335
}
3436

3537
/**

csharp/ql/src/Likely Bugs/LeapYear/UnsafeYearConstruction.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ module UnsafeYearCreationFromArithmeticConfig implements DataFlow::ConfigSig {
2626
oc.getObjectType().getABaseType*().hasFullyQualifiedName("System", "DateTime")
2727
)
2828
}
29+
30+
predicate observeDiffInformedIncrementalMode() { any() }
2931
}
3032

3133
module UnsafeYearCreationFromArithmetic =

csharp/ql/src/Security Features/CWE-091/XMLInjection.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ module XmlInjectionConfig implements DataFlow::ConfigSig {
4545
mc = node.asExpr()
4646
)
4747
}
48+
49+
predicate observeDiffInformedIncrementalMode() { any() }
4850
}
4951

5052
/**

csharp/ql/src/Security Features/CWE-114/AssemblyPathInjection.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ module AssemblyPathInjectionConfig implements DataFlow::ConfigSig {
4141
name = "UnsafeLoadFrom" and arg = 0
4242
)
4343
}
44+
45+
predicate observeDiffInformedIncrementalMode() { any() }
4446
}
4547

4648
/**

csharp/ql/src/Security Features/CWE-134/UncontrolledFormatString.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ module FormatStringConfig implements DataFlow::ConfigSig {
2222
predicate isSink(DataFlow::Node sink) {
2323
sink.asExpr() = any(FormatStringParseCall call).getFormatExpr()
2424
}
25+
26+
predicate observeDiffInformedIncrementalMode() { any() }
2527
}
2628

2729
module FormatString = TaintTracking::Global<FormatStringConfig>;

csharp/ql/src/Security Features/CWE-201/ExposureInTransmittedData.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ module ExposureInTransmittedDataConfig implements DataFlow::ConfigSig {
4141
}
4242

4343
predicate isSink(DataFlow::Node sink) { sink instanceof RemoteFlowSink }
44+
45+
predicate observeDiffInformedIncrementalMode() { any() }
4446
}
4547

4648
module ExposureInTransmittedData = TaintTracking::Global<ExposureInTransmittedDataConfig>;

csharp/ql/src/Security Features/CWE-209/ExceptionInformationExposure.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ module ExceptionInformationExposureConfig implements DataFlow::ConfigSig {
5959
// Do not flow through Message
6060
sanitizer.asExpr().getType().(RefType).getABaseType*() instanceof SystemExceptionClass
6161
}
62+
63+
predicate observeDiffInformedIncrementalMode() { any() }
6264
}
6365

6466
/**

csharp/ql/src/Security Features/CWE-327/DontInstallRootCert.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ module AddCertToRootStoreConfig implements DataFlow::ConfigSig {
3737
sink.asExpr() = mc.getQualifier()
3838
)
3939
}
40+
41+
predicate observeDiffInformedIncrementalMode() { any() }
4042
}
4143

4244
module AddCertToRootStore = DataFlow::Global<AddCertToRootStoreConfig>;

csharp/ql/src/Security Features/CWE-327/InsecureSQLConnection.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ module InsecureSqlConnectionConfig implements DataFlow::ConfigSig {
4040
)
4141
)
4242
}
43+
44+
predicate observeDiffInformedIncrementalMode() { any() }
4345
}
4446

4547
/**

csharp/ql/src/Security Features/InsecureRandomness.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ module Random {
4949
// succ = array_or_indexer[pred] - use of random numbers in an index
5050
succ.asExpr().(ElementAccess).getAnIndex() = pred.asExpr()
5151
}
52+
53+
predicate observeDiffInformedIncrementalMode() { any() }
5254
}
5355

5456
/**

0 commit comments

Comments
 (0)