Skip to content

Commit a0f6b5e

Browse files
committed
Update test expectations
1 parent da4049e commit a0f6b5e

File tree

8 files changed

+82
-0
lines changed

8 files changed

+82
-0
lines changed

go/ql/test/experimental/CWE-74/DsnInjection.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
edges
22
| Dsn.go:47:10:47:30 | call to FormValue | Dsn.go:49:102:49:105 | name |
3+
| Dsn.go:49:11:49:106 | []type{args} [array] | Dsn.go:49:11:49:106 | call to Sprintf |
34
| Dsn.go:49:11:49:106 | call to Sprintf | Dsn.go:50:29:50:33 | dbDSN |
5+
| Dsn.go:49:102:49:105 | name | Dsn.go:49:11:49:106 | []type{args} [array] |
46
| Dsn.go:49:102:49:105 | name | Dsn.go:49:11:49:106 | call to Sprintf |
57
nodes
68
| Dsn.go:47:10:47:30 | call to FormValue | semmle.label | call to FormValue |
9+
| Dsn.go:49:11:49:106 | []type{args} [array] | semmle.label | []type{args} [array] |
710
| Dsn.go:49:11:49:106 | call to Sprintf | semmle.label | call to Sprintf |
811
| Dsn.go:49:102:49:105 | name | semmle.label | name |
912
| Dsn.go:50:29:50:33 | dbDSN | semmle.label | dbDSN |

go/ql/test/experimental/CWE-74/DsnInjectionLocal.expected

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
edges
22
| Dsn.go:26:11:26:17 | selection of Args | Dsn.go:28:102:28:109 | index expression |
3+
| Dsn.go:28:11:28:110 | []type{args} [array] | Dsn.go:28:11:28:110 | call to Sprintf |
34
| Dsn.go:28:11:28:110 | call to Sprintf | Dsn.go:29:29:29:33 | dbDSN |
5+
| Dsn.go:28:102:28:109 | index expression | Dsn.go:28:11:28:110 | []type{args} [array] |
46
| Dsn.go:28:102:28:109 | index expression | Dsn.go:28:11:28:110 | call to Sprintf |
57
| Dsn.go:62:2:62:4 | definition of cfg [pointer] | Dsn.go:63:9:63:11 | cfg [pointer] |
68
| Dsn.go:62:2:62:4 | definition of cfg [pointer] | Dsn.go:67:102:67:104 | cfg [pointer] |
@@ -10,13 +12,16 @@ edges
1012
| Dsn.go:63:9:63:11 | implicit dereference | Dsn.go:67:102:67:108 | selection of dsn |
1113
| Dsn.go:63:19:63:25 | selection of Args | Dsn.go:63:19:63:29 | slice expression |
1214
| Dsn.go:63:19:63:29 | slice expression | Dsn.go:63:9:63:11 | implicit dereference |
15+
| Dsn.go:67:11:67:109 | []type{args} [array] | Dsn.go:67:11:67:109 | call to Sprintf |
1316
| Dsn.go:67:11:67:109 | call to Sprintf | Dsn.go:68:29:68:33 | dbDSN |
1417
| Dsn.go:67:102:67:104 | cfg [pointer] | Dsn.go:67:102:67:104 | implicit dereference |
1518
| Dsn.go:67:102:67:104 | implicit dereference | Dsn.go:63:9:63:11 | implicit dereference |
1619
| Dsn.go:67:102:67:104 | implicit dereference | Dsn.go:67:102:67:108 | selection of dsn |
20+
| Dsn.go:67:102:67:108 | selection of dsn | Dsn.go:67:11:67:109 | []type{args} [array] |
1721
| Dsn.go:67:102:67:108 | selection of dsn | Dsn.go:67:11:67:109 | call to Sprintf |
1822
nodes
1923
| Dsn.go:26:11:26:17 | selection of Args | semmle.label | selection of Args |
24+
| Dsn.go:28:11:28:110 | []type{args} [array] | semmle.label | []type{args} [array] |
2025
| Dsn.go:28:11:28:110 | call to Sprintf | semmle.label | call to Sprintf |
2126
| Dsn.go:28:102:28:109 | index expression | semmle.label | index expression |
2227
| Dsn.go:29:29:29:33 | dbDSN | semmle.label | dbDSN |
@@ -25,6 +30,7 @@ nodes
2530
| Dsn.go:63:9:63:11 | implicit dereference | semmle.label | implicit dereference |
2631
| Dsn.go:63:19:63:25 | selection of Args | semmle.label | selection of Args |
2732
| Dsn.go:63:19:63:29 | slice expression | semmle.label | slice expression |
33+
| Dsn.go:67:11:67:109 | []type{args} [array] | semmle.label | []type{args} [array] |
2834
| Dsn.go:67:11:67:109 | call to Sprintf | semmle.label | call to Sprintf |
2935
| Dsn.go:67:102:67:104 | cfg [pointer] | semmle.label | cfg [pointer] |
3036
| Dsn.go:67:102:67:104 | implicit dereference | semmle.label | implicit dereference |

go/ql/test/experimental/CWE-918/SSRF.expected

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ edges
77
| new-tests.go:26:26:26:30 | &... | new-tests.go:31:48:31:56 | selection of word |
88
| new-tests.go:26:26:26:30 | &... | new-tests.go:32:48:32:56 | selection of safe |
99
| new-tests.go:26:26:26:30 | &... | new-tests.go:35:49:35:57 | selection of word |
10+
| new-tests.go:31:11:31:57 | []type{args} [array] | new-tests.go:31:11:31:57 | call to Sprintf |
11+
| new-tests.go:31:48:31:56 | selection of word | new-tests.go:31:11:31:57 | []type{args} [array] |
1012
| new-tests.go:31:48:31:56 | selection of word | new-tests.go:31:11:31:57 | call to Sprintf |
13+
| new-tests.go:32:11:32:57 | []type{args} [array] | new-tests.go:32:11:32:57 | call to Sprintf |
14+
| new-tests.go:32:48:32:56 | selection of safe | new-tests.go:32:11:32:57 | []type{args} [array] |
1115
| new-tests.go:32:48:32:56 | selection of safe | new-tests.go:32:11:32:57 | call to Sprintf |
16+
| new-tests.go:35:12:35:58 | []type{args} [array] | new-tests.go:35:12:35:58 | call to Sprintf |
17+
| new-tests.go:35:49:35:57 | selection of word | new-tests.go:35:12:35:58 | []type{args} [array] |
1218
| new-tests.go:35:49:35:57 | selection of word | new-tests.go:35:12:35:58 | call to Sprintf |
1319
| new-tests.go:39:18:39:30 | call to Param | new-tests.go:47:11:47:46 | ...+... |
1420
| new-tests.go:49:18:49:30 | call to Query | new-tests.go:50:11:50:46 | ...+... |
@@ -18,8 +24,14 @@ edges
1824
| new-tests.go:63:26:63:30 | &... | new-tests.go:68:48:68:56 | selection of word |
1925
| new-tests.go:63:26:63:30 | &... | new-tests.go:69:48:69:56 | selection of safe |
2026
| new-tests.go:63:26:63:30 | &... | new-tests.go:74:49:74:57 | selection of word |
27+
| new-tests.go:68:11:68:57 | []type{args} [array] | new-tests.go:68:11:68:57 | call to Sprintf |
28+
| new-tests.go:68:48:68:56 | selection of word | new-tests.go:68:11:68:57 | []type{args} [array] |
2129
| new-tests.go:68:48:68:56 | selection of word | new-tests.go:68:11:68:57 | call to Sprintf |
30+
| new-tests.go:69:11:69:57 | []type{args} [array] | new-tests.go:69:11:69:57 | call to Sprintf |
31+
| new-tests.go:69:48:69:56 | selection of safe | new-tests.go:69:11:69:57 | []type{args} [array] |
2232
| new-tests.go:69:48:69:56 | selection of safe | new-tests.go:69:11:69:57 | call to Sprintf |
33+
| new-tests.go:74:12:74:58 | []type{args} [array] | new-tests.go:74:12:74:58 | call to Sprintf |
34+
| new-tests.go:74:49:74:57 | selection of word | new-tests.go:74:12:74:58 | []type{args} [array] |
2335
| new-tests.go:74:49:74:57 | selection of word | new-tests.go:74:12:74:58 | call to Sprintf |
2436
| new-tests.go:78:18:78:24 | selection of URL | new-tests.go:78:18:78:32 | call to Query |
2537
| new-tests.go:78:18:78:32 | call to Query | new-tests.go:78:18:78:46 | call to Get |
@@ -41,10 +53,13 @@ nodes
4153
| builtin.go:129:21:129:31 | call to Referer | semmle.label | call to Referer |
4254
| builtin.go:132:38:132:51 | untrustedInput | semmle.label | untrustedInput |
4355
| new-tests.go:26:26:26:30 | &... | semmle.label | &... |
56+
| new-tests.go:31:11:31:57 | []type{args} [array] | semmle.label | []type{args} [array] |
4457
| new-tests.go:31:11:31:57 | call to Sprintf | semmle.label | call to Sprintf |
4558
| new-tests.go:31:48:31:56 | selection of word | semmle.label | selection of word |
59+
| new-tests.go:32:11:32:57 | []type{args} [array] | semmle.label | []type{args} [array] |
4660
| new-tests.go:32:11:32:57 | call to Sprintf | semmle.label | call to Sprintf |
4761
| new-tests.go:32:48:32:56 | selection of safe | semmle.label | selection of safe |
62+
| new-tests.go:35:12:35:58 | []type{args} [array] | semmle.label | []type{args} [array] |
4863
| new-tests.go:35:12:35:58 | call to Sprintf | semmle.label | call to Sprintf |
4964
| new-tests.go:35:49:35:57 | selection of word | semmle.label | selection of word |
5065
| new-tests.go:39:18:39:30 | call to Param | semmle.label | call to Param |
@@ -55,10 +70,13 @@ nodes
5570
| new-tests.go:62:31:62:38 | selection of Body | semmle.label | selection of Body |
5671
| new-tests.go:63:17:63:23 | reqBody | semmle.label | reqBody |
5772
| new-tests.go:63:26:63:30 | &... | semmle.label | &... |
73+
| new-tests.go:68:11:68:57 | []type{args} [array] | semmle.label | []type{args} [array] |
5874
| new-tests.go:68:11:68:57 | call to Sprintf | semmle.label | call to Sprintf |
5975
| new-tests.go:68:48:68:56 | selection of word | semmle.label | selection of word |
76+
| new-tests.go:69:11:69:57 | []type{args} [array] | semmle.label | []type{args} [array] |
6077
| new-tests.go:69:11:69:57 | call to Sprintf | semmle.label | call to Sprintf |
6178
| new-tests.go:69:48:69:56 | selection of safe | semmle.label | selection of safe |
79+
| new-tests.go:74:12:74:58 | []type{args} [array] | semmle.label | []type{args} [array] |
6280
| new-tests.go:74:12:74:58 | call to Sprintf | semmle.label | call to Sprintf |
6381
| new-tests.go:74:49:74:57 | selection of word | semmle.label | selection of word |
6482
| new-tests.go:78:18:78:24 | selection of URL | semmle.label | selection of URL |

go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalTaintStep.expected

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
| file://:0:0:0:0 | [summary param] 0 in SplitAfter | file://:0:0:0:0 | [summary] to write: ReturnValue in SplitAfter |
6868
| file://:0:0:0:0 | [summary param] 0 in SplitAfterN | file://:0:0:0:0 | [summary] to write: ReturnValue in SplitAfterN |
6969
| file://:0:0:0:0 | [summary param] 0 in SplitN | file://:0:0:0:0 | [summary] to write: ReturnValue in SplitN |
70+
| file://:0:0:0:0 | [summary param] 0 in Sprintf | file://:0:0:0:0 | [summary] to write: ReturnValue in Sprintf |
7071
| file://:0:0:0:0 | [summary param] 0 in Store | file://:0:0:0:0 | [summary] to write: Argument[-1] in Store |
7172
| file://:0:0:0:0 | [summary param] 0 in Store | file://:0:0:0:0 | [summary] to write: Argument[-1] in Store |
7273
| file://:0:0:0:0 | [summary param] 0 in Store | file://:0:0:0:0 | [summary] to write: Argument[-1] in Store |
@@ -133,6 +134,7 @@
133134
| file://:0:0:0:0 | [summary param] 1 in AppendQuoteToASCII | file://:0:0:0:0 | [summary] to write: ReturnValue in AppendQuoteToASCII |
134135
| file://:0:0:0:0 | [summary param] 1 in AppendQuoteToGraphic | file://:0:0:0:0 | [summary] to write: ReturnValue in AppendQuoteToGraphic |
135136
| file://:0:0:0:0 | [summary param] 1 in AppendSlice | file://:0:0:0:0 | [summary] to write: ReturnValue in AppendSlice |
137+
| file://:0:0:0:0 | [summary param] 1 in Appendf | file://:0:0:0:0 | [summary] to write: ReturnValue in Appendf |
136138
| file://:0:0:0:0 | [summary param] 1 in Copy | file://:0:0:0:0 | [summary] to write: Argument[0] in Copy |
137139
| file://:0:0:0:0 | [summary param] 1 in Copy | file://:0:0:0:0 | [summary] to write: Argument[0] in Copy |
138140
| file://:0:0:0:0 | [summary param] 1 in CopyBuffer | file://:0:0:0:0 | [summary] to write: Argument[0] in CopyBuffer |
@@ -287,6 +289,15 @@
287289
| file://:0:0:0:0 | [summary param] -1 in WriteTo | file://:0:0:0:0 | [summary] to write: Argument[0] in WriteTo |
288290
| file://:0:0:0:0 | [summary param] -1 in WriteTo | file://:0:0:0:0 | [summary] to write: Argument[0] in WriteTo |
289291
| file://:0:0:0:0 | [summary param] -1 in WriteTo | file://:0:0:0:0 | [summary] to write: Argument[0] in WriteTo |
292+
| file://:0:0:0:0 | [summary] read: Argument[0].ArrayElement in Append | file://:0:0:0:0 | [summary] to write: ReturnValue in Append |
293+
| file://:0:0:0:0 | [summary] read: Argument[0].ArrayElement in Appendf | file://:0:0:0:0 | [summary] to write: ReturnValue in Appendf |
294+
| file://:0:0:0:0 | [summary] read: Argument[0].ArrayElement in Appendln | file://:0:0:0:0 | [summary] to write: ReturnValue in Appendln |
295+
| file://:0:0:0:0 | [summary] read: Argument[0].ArrayElement in Sprint | file://:0:0:0:0 | [summary] to write: ReturnValue in Sprint |
296+
| file://:0:0:0:0 | [summary] read: Argument[0].ArrayElement in Sprintln | file://:0:0:0:0 | [summary] to write: ReturnValue in Sprintln |
297+
| file://:0:0:0:0 | [summary] read: Argument[1].ArrayElement in Append | file://:0:0:0:0 | [summary] to write: ReturnValue in Append |
298+
| file://:0:0:0:0 | [summary] read: Argument[1].ArrayElement in Appendln | file://:0:0:0:0 | [summary] to write: ReturnValue in Appendln |
299+
| file://:0:0:0:0 | [summary] read: Argument[1].ArrayElement in Sprintf | file://:0:0:0:0 | [summary] to write: ReturnValue in Sprintf |
300+
| file://:0:0:0:0 | [summary] read: Argument[2].ArrayElement in Appendf | file://:0:0:0:0 | [summary] to write: ReturnValue in Appendf |
290301
| main.go:26:11:26:17 | type assertion | main.go:26:2:26:17 | ... := ...[0] |
291302
| main.go:26:11:26:17 | type assertion | main.go:26:2:26:17 | ... := ...[1] |
292303
| main.go:38:13:38:13 | 1 | main.go:38:7:38:20 | slice literal |

go/ql/test/library-tests/semmle/go/frameworks/TaintSteps/TaintStep.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,11 @@
318318
| errors.As | file://:0:0:0:0 | [summary param] 0 in As | file://:0:0:0:0 | [summary] to write: Argument[1] in As |
319319
| errors.New | file://:0:0:0:0 | [summary param] 0 in New | file://:0:0:0:0 | [summary] to write: ReturnValue in New |
320320
| errors.Unwrap | file://:0:0:0:0 | [summary param] 0 in Unwrap | file://:0:0:0:0 | [summary] to write: ReturnValue in Unwrap |
321+
| fmt.Appendf | file://:0:0:0:0 | [summary param] 1 in Appendf | file://:0:0:0:0 | [summary] to write: ReturnValue in Appendf |
321322
| fmt.GoStringer.GoString | file://:0:0:0:0 | [summary param] -1 in GoString | file://:0:0:0:0 | [summary] to write: ReturnValue in GoString |
322323
| fmt.ScanState.Read | file://:0:0:0:0 | [summary param] -1 in Read | file://:0:0:0:0 | [summary] to write: Argument[0] in Read |
323324
| fmt.ScanState.Token | file://:0:0:0:0 | [summary param] -1 in Token | file://:0:0:0:0 | [summary] to write: ReturnValue in Token |
325+
| fmt.Sprintf | file://:0:0:0:0 | [summary param] 0 in Sprintf | file://:0:0:0:0 | [summary] to write: ReturnValue in Sprintf |
324326
| fmt.State.Write | file://:0:0:0:0 | [summary param] 0 in Write | file://:0:0:0:0 | [summary] to write: Argument[-1] in Write |
325327
| fmt.Stringer.String | file://:0:0:0:0 | [summary param] -1 in String | file://:0:0:0:0 | [summary] to write: ReturnValue in String |
326328
| fmt.pp.Write | file://:0:0:0:0 | [summary param] 0 in Write | file://:0:0:0:0 | [summary] to write: Argument[-1] in Write |

go/ql/test/query-tests/Security/CWE-079/ReflectedXss.expected

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ edges
1313
| reflectedxsstest.go:31:2:31:44 | ... := ...[1] | reflectedxsstest.go:34:46:34:60 | selection of Filename |
1414
| reflectedxsstest.go:32:2:32:38 | ... := ...[0] | reflectedxsstest.go:33:49:33:55 | content |
1515
| reflectedxsstest.go:32:34:32:37 | file | reflectedxsstest.go:32:2:32:38 | ... := ...[0] |
16+
| reflectedxsstest.go:33:17:33:56 | []type{args} [array] | reflectedxsstest.go:33:17:33:56 | call to Sprintf |
1617
| reflectedxsstest.go:33:17:33:56 | call to Sprintf | reflectedxsstest.go:33:10:33:57 | type conversion |
18+
| reflectedxsstest.go:33:49:33:55 | content | reflectedxsstest.go:33:17:33:56 | []type{args} [array] |
1719
| reflectedxsstest.go:33:49:33:55 | content | reflectedxsstest.go:33:17:33:56 | call to Sprintf |
20+
| reflectedxsstest.go:34:17:34:61 | []type{args} [array] | reflectedxsstest.go:34:17:34:61 | call to Sprintf |
1821
| reflectedxsstest.go:34:17:34:61 | call to Sprintf | reflectedxsstest.go:34:10:34:62 | type conversion |
22+
| reflectedxsstest.go:34:46:34:60 | selection of Filename | reflectedxsstest.go:34:17:34:61 | []type{args} [array] |
1923
| reflectedxsstest.go:34:46:34:60 | selection of Filename | reflectedxsstest.go:34:17:34:61 | call to Sprintf |
2024
| reflectedxsstest.go:38:2:38:35 | ... := ...[0] | reflectedxsstest.go:39:16:39:21 | reader |
2125
| reflectedxsstest.go:39:2:39:32 | ... := ...[0] | reflectedxsstest.go:40:14:40:17 | part |
@@ -25,7 +29,9 @@ edges
2529
| reflectedxsstest.go:40:14:40:28 | call to FileName | reflectedxsstest.go:44:46:44:53 | partName |
2630
| reflectedxsstest.go:41:2:41:10 | definition of byteSlice | reflectedxsstest.go:45:10:45:18 | byteSlice |
2731
| reflectedxsstest.go:42:2:42:5 | part | reflectedxsstest.go:41:2:41:10 | definition of byteSlice |
32+
| reflectedxsstest.go:44:17:44:54 | []type{args} [array] | reflectedxsstest.go:44:17:44:54 | call to Sprintf |
2833
| reflectedxsstest.go:44:17:44:54 | call to Sprintf | reflectedxsstest.go:44:10:44:55 | type conversion |
34+
| reflectedxsstest.go:44:46:44:53 | partName | reflectedxsstest.go:44:17:44:54 | []type{args} [array] |
2935
| reflectedxsstest.go:44:46:44:53 | partName | reflectedxsstest.go:44:17:44:54 | call to Sprintf |
3036
| reflectedxsstest.go:51:14:51:18 | selection of URL | reflectedxsstest.go:51:14:51:26 | call to Query |
3137
| reflectedxsstest.go:51:14:51:26 | call to Query | reflectedxsstest.go:54:11:54:21 | type conversion |
@@ -64,9 +70,11 @@ nodes
6470
| reflectedxsstest.go:32:2:32:38 | ... := ...[0] | semmle.label | ... := ...[0] |
6571
| reflectedxsstest.go:32:34:32:37 | file | semmle.label | file |
6672
| reflectedxsstest.go:33:10:33:57 | type conversion | semmle.label | type conversion |
73+
| reflectedxsstest.go:33:17:33:56 | []type{args} [array] | semmle.label | []type{args} [array] |
6774
| reflectedxsstest.go:33:17:33:56 | call to Sprintf | semmle.label | call to Sprintf |
6875
| reflectedxsstest.go:33:49:33:55 | content | semmle.label | content |
6976
| reflectedxsstest.go:34:10:34:62 | type conversion | semmle.label | type conversion |
77+
| reflectedxsstest.go:34:17:34:61 | []type{args} [array] | semmle.label | []type{args} [array] |
7078
| reflectedxsstest.go:34:17:34:61 | call to Sprintf | semmle.label | call to Sprintf |
7179
| reflectedxsstest.go:34:46:34:60 | selection of Filename | semmle.label | selection of Filename |
7280
| reflectedxsstest.go:38:2:38:35 | ... := ...[0] | semmle.label | ... := ...[0] |
@@ -77,6 +85,7 @@ nodes
7785
| reflectedxsstest.go:41:2:41:10 | definition of byteSlice | semmle.label | definition of byteSlice |
7886
| reflectedxsstest.go:42:2:42:5 | part | semmle.label | part |
7987
| reflectedxsstest.go:44:10:44:55 | type conversion | semmle.label | type conversion |
88+
| reflectedxsstest.go:44:17:44:54 | []type{args} [array] | semmle.label | []type{args} [array] |
8089
| reflectedxsstest.go:44:17:44:54 | call to Sprintf | semmle.label | call to Sprintf |
8190
| reflectedxsstest.go:44:46:44:53 | partName | semmle.label | partName |
8291
| reflectedxsstest.go:45:10:45:18 | byteSlice | semmle.label | byteSlice |

0 commit comments

Comments
 (0)