Skip to content

Commit 7d6beb3

Browse files
committed
Go: patch-generated stubs
1 parent f65f863 commit 7d6beb3

16 files changed

+132
-0
lines changed

go/ql/lib/semmle/go/security/AllocationSizeOverflow.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ module AllocationSizeOverflow {
5656
succ = c
5757
)
5858
}
59+
60+
predicate observeDiffInformedIncrementalMode() {
61+
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 22 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-190/AllocationSizeOverflow.ql@25:80:25:86)
62+
}
5963
}
6064

6165
/** Tracks taint flow to find allocation-size overflows. */

go/ql/lib/semmle/go/security/CommandInjection.qll

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ module CommandInjection {
2424
}
2525

2626
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
27+
28+
predicate observeDiffInformedIncrementalMode() {
29+
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 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:8:28:21), Column 5 does not select a source or sink originating from the flow call on line 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:71:28:86)
30+
}
31+
32+
Location getASelectedSourceLocation(DataFlow::Node source) {
33+
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 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:8:28:21), Column 5 does not select a source or sink originating from the flow call on line 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:71:28:86)
34+
}
35+
36+
Location getASelectedSinkLocation(DataFlow::Node sink) {
37+
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 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:8:28:21), Column 5 does not select a source or sink originating from the flow call on line 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:71:28:86)
38+
}
2739
}
2840

2941
/**
@@ -80,6 +92,18 @@ module CommandInjection {
8092
node instanceof Sanitizer or
8193
node = any(ArgumentArrayWithDoubleDash array).getASanitizedElement()
8294
}
95+
96+
predicate observeDiffInformedIncrementalMode() {
97+
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 27 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:8:28:21), Column 5 does not select a source or sink originating from the flow call on line 27 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:71:28:86)
98+
}
99+
100+
Location getASelectedSourceLocation(DataFlow::Node source) {
101+
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 27 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:8:28:21), Column 5 does not select a source or sink originating from the flow call on line 27 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:71:28:86)
102+
}
103+
104+
Location getASelectedSinkLocation(DataFlow::Node sink) {
105+
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 27 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:8:28:21), Column 5 does not select a source or sink originating from the flow call on line 27 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-078/CommandInjection.ql@28:71:28:86)
106+
}
83107
}
84108

85109
/**

go/ql/lib/semmle/go/security/ExternalAPIs.qll

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

188188
predicate isSink(DataFlow::Node sink) { sink instanceof ExternalApiDataNode }
189+
190+
predicate observeDiffInformedIncrementalMode() {
191+
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/go/ql/lib/semmle/go/security/ExternalAPIs.qll@212:36:212:80), Flow call outside 'select' clause (/Users/d10c/src/semmle-code/ql/go/ql/lib/semmle/go/security/ExternalAPIs.qll@215:43:215:92)
192+
}
189193
}
190194

191195
/**

go/ql/lib/semmle/go/security/HardcodedCredentials.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ module HardcodedCredentials {
3030
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
3131

3232
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
33+
34+
predicate observeDiffInformedIncrementalMode() {
35+
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 62 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-798/HardcodedCredentials.ql@65:8:65:11), Column 3 does not select a source or sink originating from the flow call on line 62 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-798/HardcodedCredentials.ql@65:23:65:28)
36+
}
37+
38+
Location getASelectedSourceLocation(DataFlow::Node source) {
39+
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 62 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-798/HardcodedCredentials.ql@65:8:65:11), Column 3 does not select a source or sink originating from the flow call on line 62 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-798/HardcodedCredentials.ql@65:23:65:28)
40+
}
41+
42+
Location getASelectedSinkLocation(DataFlow::Node sink) {
43+
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 62 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-798/HardcodedCredentials.ql@65:8:65:11), Column 3 does not select a source or sink originating from the flow call on line 62 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-798/HardcodedCredentials.ql@65:23:65:28)
44+
}
3345
}
3446

3547
/** Tracks taint flow for reasoning about hardcoded credentials. */

go/ql/lib/semmle/go/security/IncorrectIntegerConversionLib.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,10 @@ private module ConversionWithoutBoundsCheckConfig implements DataFlow::StateConf
440440
state2 = node2.(FlowStateTransformer).transform(state1) and
441441
DataFlow::simpleLocalFlowStep(node1, node2, _)
442442
}
443+
444+
predicate observeDiffInformedIncrementalMode() {
445+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 selects sink.getASuccessor (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-681/IncorrectIntegerConversionQuery.ql@26:8:26:20)
446+
}
443447
}
444448

445449
/**

go/ql/lib/semmle/go/security/InsecureRandomness.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ module InsecureRandomness {
3939
n2.getType() instanceof IntegerType
4040
)
4141
}
42+
43+
predicate observeDiffInformedIncrementalMode() {
44+
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 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-338/InsecureRandomness.ql@33:8:33:21), Column 5 does not select a source or sink originating from the flow call on line 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-338/InsecureRandomness.ql@34:75:34:90)
45+
}
46+
47+
Location getASelectedSourceLocation(DataFlow::Node source) {
48+
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 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-338/InsecureRandomness.ql@33:8:33:21), Column 5 does not select a source or sink originating from the flow call on line 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-338/InsecureRandomness.ql@34:75:34:90)
49+
}
50+
51+
Location getASelectedSinkLocation(DataFlow::Node sink) {
52+
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 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-338/InsecureRandomness.ql@33:8:33:21), Column 5 does not select a source or sink originating from the flow call on line 26 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-338/InsecureRandomness.ql@34:75:34:90)
53+
}
4254
}
4355

4456
/**

go/ql/lib/semmle/go/security/ReflectedXss.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ module ReflectedXss {
2222
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
2323

2424
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
25+
26+
predicate observeDiffInformedIncrementalMode() {
27+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 7 selects sink.getAssociatedLoc (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-079/ReflectedXss.ql@36:84:36:90)
28+
}
2529
}
2630

2731
/** Tracks taint flow from untrusted data to XSS attack vectors. */

go/ql/lib/semmle/go/security/RequestForgery.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ module RequestForgery {
3131
w.writesField(v.getAUse(), f, pred) and succ = v.getAUse()
3232
)
3333
}
34+
35+
predicate observeDiffInformedIncrementalMode() {
36+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 selects sink.getARequest (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-918/RequestForgery.ql@25:8:25:14)
37+
}
3438
}
3539

3640
/** Tracks taint flow from untrusted data to request forgery attack vectors. */

go/ql/lib/semmle/go/security/SafeUrlFlow.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ module SafeUrlFlow {
3636
or
3737
node instanceof SanitizerEdge
3838
}
39+
40+
predicate observeDiffInformedIncrementalMode() {
41+
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 selects sink.getARequest (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-918/RequestForgery.ql@25:8:25:14), Column 5 does not select a source or sink originating from the flow call on line 24 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-601/OpenUrlRedirect.ql@26:3:26:18), Column 7 does not select a source or sink originating from the flow call on line 24 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-918/RequestForgery.ql@26:52:26:57)
42+
}
43+
44+
Location getASelectedSourceLocation(DataFlow::Node source) {
45+
none() // TODO: Make sure that this source location matches the query's select clause: Column 1 selects sink.getARequest (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-918/RequestForgery.ql@25:8:25:14), Column 5 does not select a source or sink originating from the flow call on line 24 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-601/OpenUrlRedirect.ql@26:3:26:18), Column 7 does not select a source or sink originating from the flow call on line 24 (/Users/d10c/src/semmle-code/ql/go/ql/src/Security/CWE-918/RequestForgery.ql@26:52:26:57)
46+
}
3947
}
4048

4149
/** Tracks taint flow for reasoning about safe URLs. */

go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ module UnhandledFileCloseConfig implements DataFlow::ConfigSig {
128128
predicate isSource(DataFlow::Node source) { isWritableFileHandle(source, _) }
129129

130130
predicate isSink(DataFlow::Node sink) { isCloseSink(sink, _) }
131+
132+
predicate observeDiffInformedIncrementalMode() {
133+
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 147 (/Users/d10c/src/semmle-code/ql/go/ql/src/InconsistentCode/UnhandledCloseWritableHandle.ql@153:3:153:10)
134+
}
131135
}
132136

133137
/**

0 commit comments

Comments
 (0)