Skip to content

Commit 1b9f883

Browse files
committed
C#: patch-generated stubs
1 parent 4ebb029 commit 1b9f883

File tree

5 files changed

+86
-0
lines changed

5 files changed

+86
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ private module ConditionalBypassConfig implements DataFlow::ConfigSig {
3939
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
4040

4141
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
42+
43+
predicate observeDiffInformedIncrementalMode() {
44+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 5 selects sink.getSensitiveMethodCall (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-807/ConditionalBypass.ql@23:3:23:48)
45+
}
4246
}
4347

4448
/**

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ private module RemoteSourceToExternalApiConfig implements DataFlow::ConfigSig {
7878
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
7979

8080
predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
81+
82+
predicate observeDiffInformedIncrementalMode() {
83+
any() // TODO: Make sure that the location overrides match the query's select clause: Flow call outside 'select' clause (/Users/d10c/src/semmle-code/ql/csharp/ql/lib/semmle/code/csharp/security/dataflow/ExternalAPIsQuery.qll@88:36:88:75), Flow call outside 'select' clause (/Users/d10c/src/semmle-code/ql/csharp/ql/lib/semmle/code/csharp/security/dataflow/ExternalAPIsQuery.qll@91:43:91:87)
84+
}
8185
}
8286

8387
/** A module for tracking flow from `ActiveThreatModelSource`s to `ExternalApiDataNode`s. */

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

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ private module TaintToObjectMethodTrackingConfig implements DataFlow::ConfigSig
5959
predicate isSink(DataFlow::Node sink) { sink instanceof InstanceMethodSink }
6060

6161
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
62+
63+
predicate observeDiffInformedIncrementalMode() {
64+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
65+
}
66+
67+
Location getASelectedSourceLocation(DataFlow::Node source) {
68+
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
69+
}
70+
71+
Location getASelectedSinkLocation(DataFlow::Node sink) {
72+
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 33 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
73+
}
6274
}
6375

6476
/**
@@ -77,6 +89,18 @@ private module JsonConvertTrackingConfig implements DataFlow::ConfigSig {
7789
}
7890

7991
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
92+
93+
predicate observeDiffInformedIncrementalMode() {
94+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 55 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 55 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
95+
}
96+
97+
Location getASelectedSourceLocation(DataFlow::Node source) {
98+
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 55 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 55 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
99+
}
100+
101+
Location getASelectedSinkLocation(DataFlow::Node sink) {
102+
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 55 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 55 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
103+
}
80104
}
81105

82106
/**
@@ -133,6 +157,18 @@ private module TypeNameTrackingConfig implements DataFlow::ConfigSig {
133157
)
134158
)
135159
}
160+
161+
predicate observeDiffInformedIncrementalMode() {
162+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 56 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 56 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
163+
}
164+
165+
Location getASelectedSourceLocation(DataFlow::Node source) {
166+
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 56 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 56 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
167+
}
168+
169+
Location getASelectedSinkLocation(DataFlow::Node sink) {
170+
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 56 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 56 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
171+
}
136172
}
137173

138174
/**
@@ -149,6 +185,18 @@ private module TaintToConstructorOrStaticMethodTrackingConfig implements DataFlo
149185
predicate isSink(DataFlow::Node sink) { sink instanceof ConstructorOrStaticMethodSink }
150186

151187
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
188+
189+
predicate observeDiffInformedIncrementalMode() {
190+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 50 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 50 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
191+
}
192+
193+
Location getASelectedSourceLocation(DataFlow::Node source) {
194+
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 50 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 50 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
195+
}
196+
197+
Location getASelectedSinkLocation(DataFlow::Node sink) {
198+
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 50 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 50 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
199+
}
152200
}
153201

154202
/**
@@ -186,6 +234,18 @@ private module TaintToObjectTypeTrackingConfig implements DataFlow::ConfigSig {
186234
oc.getObjectType() instanceof StrongTypeDeserializer
187235
)
188236
}
237+
238+
predicate observeDiffInformedIncrementalMode() {
239+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 43 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 43 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
240+
}
241+
242+
Location getASelectedSourceLocation(DataFlow::Node source) {
243+
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 43 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 43 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
244+
}
245+
246+
Location getASelectedSinkLocation(DataFlow::Node sink) {
247+
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 43 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 43 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
248+
}
189249
}
190250

191251
/**
@@ -210,6 +270,18 @@ private module WeakTypeCreationToUsageTrackingConfig implements DataFlow::Config
210270
sink.asExpr() = mc.getQualifier()
211271
)
212272
}
273+
274+
predicate observeDiffInformedIncrementalMode() {
275+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 37 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 37 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
276+
}
277+
278+
Location getASelectedSourceLocation(DataFlow::Node source) {
279+
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 37 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 37 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
280+
}
281+
282+
Location getASelectedSinkLocation(DataFlow::Node sink) {
283+
none() // TODO: Make sure that this sink location matches the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 37 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@59:8:59:25), Column 5 does not select a source or sink originating from the flow call on line 37 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql@60:3:60:11)
284+
}
213285
}
214286

215287
/**

csharp/ql/src/Likely Bugs/ThreadUnsafeICryptoTransformLambda.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module NotThreadSafeCryptoUsageIntoParallelInvokeConfig implements DataFlow::Con
2424
}
2525

2626
predicate isSink(DataFlow::Node sink) { sink instanceof ParallelSink }
27+
28+
predicate observeDiffInformedIncrementalMode() { any() }
2729
}
2830

2931
module NotThreadSafeCryptoUsageIntoParallelInvoke =

csharp/ql/src/Security Features/CWE-798/HardcodedConnectionString.ql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ module ConnectionStringConfig implements DataFlow::ConfigSig {
3838
}
3939

4040
predicate isBarrier(DataFlow::Node node) { node instanceof StringFormatSanitizer }
41+
42+
predicate observeDiffInformedIncrementalMode() {
43+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 5 does not select a source or sink originating from the flow call on line 49 (/Users/d10c/src/semmle-code/ql/csharp/ql/src/Security Features/CWE-798/HardcodedConnectionString.ql@52:3:52:73)
44+
}
4145
}
4246

4347
/**

0 commit comments

Comments
 (0)