File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
javascript/ql/test/library-tests/TripleDot Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -20,3 +20,26 @@ function shiftTaint() {
20
20
sink ( array . shift ( ) ) ; // $ hasTaintFlow=shift.directly-tainted
21
21
sink ( array . shift ( ) ) ; // $ hasTaintFlow=shift.directly-tainted
22
22
}
23
+
24
+ function implicitToString ( ) {
25
+ const array = [ source ( 'implicitToString.1' ) ] ;
26
+ array . push ( source ( 'implicitToString.2' ) )
27
+
28
+ sink ( array + "foo" ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
29
+ sink ( "foo" + array ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
30
+ sink ( "" + array ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
31
+ sink ( array + 1 ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
32
+ sink ( 1 + array ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
33
+ sink ( unknown ( ) + array ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
34
+ sink ( array + unknown ( ) ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
35
+
36
+ sink ( `${ array } ` ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
37
+ sink ( `${ array } foo` ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
38
+
39
+ sink ( String ( array ) ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
40
+
41
+ sink ( array . toString ( ) ) ; // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
42
+ sink ( array . toString ( "utf8" ) ) ; // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
43
+
44
+ sink ( Array . prototype . toString . call ( array ) ) ; // $ MISSING: hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2
45
+ }
You can’t perform that action at this time.
0 commit comments