Skip to content

Commit e810ba4

Browse files
committed
Ruby: Expand flowToAnyArg test
1 parent 0879b6a commit e810ba4

File tree

2 files changed

+48
-43
lines changed

2 files changed

+48
-43
lines changed

ruby/ql/test/library-tests/dataflow/summaries/Summaries.expected

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ edges
2424
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:57:27:57:33 | tainted : |
2525
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:61:32:61:38 | tainted : |
2626
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:63:23:63:29 | tainted : |
27-
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:93:16:93:22 | tainted : |
28-
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:99:14:99:20 | tainted : |
29-
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:102:16:102:22 | tainted |
30-
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:102:16:102:22 | tainted |
31-
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:103:21:103:27 | tainted |
32-
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:103:21:103:27 | tainted |
33-
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:106:26:106:32 | tainted |
34-
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:106:26:106:32 | tainted |
27+
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:98:16:98:22 | tainted : |
28+
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:104:14:104:20 | tainted : |
29+
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:107:16:107:22 | tainted |
30+
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:107:16:107:22 | tainted |
31+
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:108:21:108:27 | tainted |
32+
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:108:21:108:27 | tainted |
33+
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:111:26:111:32 | tainted |
34+
| summaries.rb:1:11:1:36 | call to identity : | summaries.rb:111:26:111:32 | tainted |
3535
| summaries.rb:1:20:1:36 | call to source : | summaries.rb:1:11:1:36 | call to identity : |
3636
| summaries.rb:1:20:1:36 | call to source : | summaries.rb:1:11:1:36 | call to identity : |
3737
| summaries.rb:4:12:7:3 | call to apply_block : | summaries.rb:9:6:9:13 | tainted2 |
@@ -96,17 +96,17 @@ edges
9696
| summaries.rb:85:1:85:1 | a [element 2] : | summaries.rb:85:1:85:1 | [post] a [element 2] : |
9797
| summaries.rb:88:6:88:6 | a [element 2] : | summaries.rb:88:6:88:9 | ...[...] |
9898
| summaries.rb:88:6:88:6 | a [element 2] : | summaries.rb:88:6:88:9 | ...[...] |
99-
| summaries.rb:93:16:93:22 | [post] tainted : | summaries.rb:99:14:99:20 | tainted : |
100-
| summaries.rb:93:16:93:22 | [post] tainted : | summaries.rb:102:16:102:22 | tainted |
101-
| summaries.rb:93:16:93:22 | [post] tainted : | summaries.rb:103:21:103:27 | tainted |
102-
| summaries.rb:93:16:93:22 | [post] tainted : | summaries.rb:106:26:106:32 | tainted |
103-
| summaries.rb:93:16:93:22 | tainted : | summaries.rb:93:16:93:22 | [post] tainted : |
104-
| summaries.rb:93:16:93:22 | tainted : | summaries.rb:93:25:93:25 | [post] y : |
105-
| summaries.rb:93:16:93:22 | tainted : | summaries.rb:93:33:93:33 | [post] z : |
106-
| summaries.rb:93:25:93:25 | [post] y : | summaries.rb:95:6:95:6 | y |
107-
| summaries.rb:93:33:93:33 | [post] z : | summaries.rb:96:6:96:6 | z |
108-
| summaries.rb:99:1:99:1 | [post] x : | summaries.rb:100:6:100:6 | x |
109-
| summaries.rb:99:14:99:20 | tainted : | summaries.rb:99:1:99:1 | [post] x : |
99+
| summaries.rb:98:16:98:22 | [post] tainted : | summaries.rb:104:14:104:20 | tainted : |
100+
| summaries.rb:98:16:98:22 | [post] tainted : | summaries.rb:107:16:107:22 | tainted |
101+
| summaries.rb:98:16:98:22 | [post] tainted : | summaries.rb:108:21:108:27 | tainted |
102+
| summaries.rb:98:16:98:22 | [post] tainted : | summaries.rb:111:26:111:32 | tainted |
103+
| summaries.rb:98:16:98:22 | tainted : | summaries.rb:98:16:98:22 | [post] tainted : |
104+
| summaries.rb:98:16:98:22 | tainted : | summaries.rb:98:25:98:25 | [post] y : |
105+
| summaries.rb:98:16:98:22 | tainted : | summaries.rb:98:33:98:33 | [post] z : |
106+
| summaries.rb:98:25:98:25 | [post] y : | summaries.rb:100:6:100:6 | y |
107+
| summaries.rb:98:33:98:33 | [post] z : | summaries.rb:101:6:101:6 | z |
108+
| summaries.rb:104:1:104:1 | [post] x : | summaries.rb:105:6:105:6 | x |
109+
| summaries.rb:104:14:104:20 | tainted : | summaries.rb:104:1:104:1 | [post] x : |
110110
nodes
111111
| summaries.rb:1:11:1:36 | call to identity : | semmle.label | call to identity : |
112112
| summaries.rb:1:11:1:36 | call to identity : | semmle.label | call to identity : |
@@ -206,21 +206,21 @@ nodes
206206
| summaries.rb:88:6:88:6 | a [element 2] : | semmle.label | a [element 2] : |
207207
| summaries.rb:88:6:88:9 | ...[...] | semmle.label | ...[...] |
208208
| summaries.rb:88:6:88:9 | ...[...] | semmle.label | ...[...] |
209-
| summaries.rb:93:16:93:22 | [post] tainted : | semmle.label | [post] tainted : |
210-
| summaries.rb:93:16:93:22 | tainted : | semmle.label | tainted : |
211-
| summaries.rb:93:25:93:25 | [post] y : | semmle.label | [post] y : |
212-
| summaries.rb:93:33:93:33 | [post] z : | semmle.label | [post] z : |
213-
| summaries.rb:95:6:95:6 | y | semmle.label | y |
214-
| summaries.rb:96:6:96:6 | z | semmle.label | z |
215-
| summaries.rb:99:1:99:1 | [post] x : | semmle.label | [post] x : |
216-
| summaries.rb:99:14:99:20 | tainted : | semmle.label | tainted : |
217-
| summaries.rb:100:6:100:6 | x | semmle.label | x |
218-
| summaries.rb:102:16:102:22 | tainted | semmle.label | tainted |
219-
| summaries.rb:102:16:102:22 | tainted | semmle.label | tainted |
220-
| summaries.rb:103:21:103:27 | tainted | semmle.label | tainted |
221-
| summaries.rb:103:21:103:27 | tainted | semmle.label | tainted |
222-
| summaries.rb:106:26:106:32 | tainted | semmle.label | tainted |
223-
| summaries.rb:106:26:106:32 | tainted | semmle.label | tainted |
209+
| summaries.rb:98:16:98:22 | [post] tainted : | semmle.label | [post] tainted : |
210+
| summaries.rb:98:16:98:22 | tainted : | semmle.label | tainted : |
211+
| summaries.rb:98:25:98:25 | [post] y : | semmle.label | [post] y : |
212+
| summaries.rb:98:33:98:33 | [post] z : | semmle.label | [post] z : |
213+
| summaries.rb:100:6:100:6 | y | semmle.label | y |
214+
| summaries.rb:101:6:101:6 | z | semmle.label | z |
215+
| summaries.rb:104:1:104:1 | [post] x : | semmle.label | [post] x : |
216+
| summaries.rb:104:14:104:20 | tainted : | semmle.label | tainted : |
217+
| summaries.rb:105:6:105:6 | x | semmle.label | x |
218+
| summaries.rb:107:16:107:22 | tainted | semmle.label | tainted |
219+
| summaries.rb:107:16:107:22 | tainted | semmle.label | tainted |
220+
| summaries.rb:108:21:108:27 | tainted | semmle.label | tainted |
221+
| summaries.rb:108:21:108:27 | tainted | semmle.label | tainted |
222+
| summaries.rb:111:26:111:32 | tainted | semmle.label | tainted |
223+
| summaries.rb:111:26:111:32 | tainted | semmle.label | tainted |
224224
subpaths
225225
invalidSpecComponent
226226
#select
@@ -266,15 +266,15 @@ invalidSpecComponent
266266
| summaries.rb:83:6:83:9 | ...[...] | summaries.rb:77:15:77:29 | call to source : | summaries.rb:83:6:83:9 | ...[...] | $@ | summaries.rb:77:15:77:29 | call to source : | call to source : |
267267
| summaries.rb:88:6:88:9 | ...[...] | summaries.rb:77:32:77:46 | call to source : | summaries.rb:88:6:88:9 | ...[...] | $@ | summaries.rb:77:32:77:46 | call to source : | call to source : |
268268
| summaries.rb:88:6:88:9 | ...[...] | summaries.rb:77:32:77:46 | call to source : | summaries.rb:88:6:88:9 | ...[...] | $@ | summaries.rb:77:32:77:46 | call to source : | call to source : |
269-
| summaries.rb:95:6:95:6 | y | summaries.rb:1:20:1:36 | call to source : | summaries.rb:95:6:95:6 | y | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
270-
| summaries.rb:96:6:96:6 | z | summaries.rb:1:20:1:36 | call to source : | summaries.rb:96:6:96:6 | z | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
271-
| summaries.rb:100:6:100:6 | x | summaries.rb:1:20:1:36 | call to source : | summaries.rb:100:6:100:6 | x | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
272-
| summaries.rb:102:16:102:22 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:102:16:102:22 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
273-
| summaries.rb:102:16:102:22 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:102:16:102:22 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
274-
| summaries.rb:103:21:103:27 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:103:21:103:27 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
275-
| summaries.rb:103:21:103:27 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:103:21:103:27 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
276-
| summaries.rb:106:26:106:32 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:106:26:106:32 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
277-
| summaries.rb:106:26:106:32 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:106:26:106:32 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
269+
| summaries.rb:100:6:100:6 | y | summaries.rb:1:20:1:36 | call to source : | summaries.rb:100:6:100:6 | y | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
270+
| summaries.rb:101:6:101:6 | z | summaries.rb:1:20:1:36 | call to source : | summaries.rb:101:6:101:6 | z | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
271+
| summaries.rb:105:6:105:6 | x | summaries.rb:1:20:1:36 | call to source : | summaries.rb:105:6:105:6 | x | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
272+
| summaries.rb:107:16:107:22 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:107:16:107:22 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
273+
| summaries.rb:107:16:107:22 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:107:16:107:22 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
274+
| summaries.rb:108:21:108:27 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:108:21:108:27 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
275+
| summaries.rb:108:21:108:27 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:108:21:108:27 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
276+
| summaries.rb:111:26:111:32 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:111:26:111:32 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
277+
| summaries.rb:111:26:111:32 | tainted | summaries.rb:1:20:1:36 | call to source : | summaries.rb:111:26:111:32 | tainted | $@ | summaries.rb:1:20:1:36 | call to source : | call to source : |
278278
warning
279279
| CSV type row should have 5 columns but has 2: test;TooFewColumns |
280280
| CSV type row should have 5 columns but has 8: test;TooManyColumns;;;Member[Foo].Instance;too;many;columns |

ruby/ql/test/library-tests/dataflow/summaries/summaries.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ def userDefinedFunction(x, y)
9090
x = Foo.new
9191
y = []
9292
z = []
93+
# This just highlights that none of x,y,z was tainted before
94+
sink(x)
95+
sink(y)
96+
sink(z)
97+
9398
x.flowToAnyArg(tainted, y, key: z)
9499
sink(x)
95100
sink(y) # $ hasTaintFlow=tainted

0 commit comments

Comments
 (0)