@@ -86,7 +86,8 @@ module ArrayTaintTracking {
8686 succ .( DataFlow:: SourceNode ) .getAMethodCall ( "splice" ) = call
8787 or
8888 // `e = array.pop()`, `e = array.shift()`, or similar: if `array` is tainted, then so is `e`.
89- call .( DataFlow:: MethodCallNode ) .calls ( pred , [ "pop" , "shift" , "slice" , "splice" , "at" , "toSpliced" ] ) and
89+ call .( DataFlow:: MethodCallNode )
90+ .calls ( pred , [ "pop" , "shift" , "slice" , "splice" , "at" , "toSpliced" ] ) and
9091 succ = call
9192 or
9293 // `e = Array.from(x)`: if `x` is tainted, then so is `e`.
@@ -283,7 +284,7 @@ private module ArrayDataFlow {
283284 private class ArraySpliceStep extends PreCallGraphStep {
284285 override predicate storeStep ( DataFlow:: Node element , DataFlow:: SourceNode obj , string prop ) {
285286 exists ( DataFlow:: MethodCallNode call |
286- call .getMethodName ( ) = "splice" and
287+ call .getMethodName ( ) = [ "splice" , "toSpliced" ] and
287288 prop = arrayElement ( ) and
288289 element = call .getArgument ( any ( int i | i >= 2 ) ) and
289290 call = obj .getAMethodCall ( )
@@ -297,7 +298,7 @@ private module ArrayDataFlow {
297298 toProp = arrayElement ( ) and
298299 // `array.splice(i, del, ...arr)` variant
299300 exists ( DataFlow:: MethodCallNode mcn |
300- mcn .getMethodName ( ) = "splice" and
301+ mcn .getMethodName ( ) = [ "splice" , "toSpliced" ] and
301302 pred = mcn .getASpreadArgument ( ) and
302303 succ = mcn .getReceiver ( ) .getALocalSource ( )
303304 )
@@ -320,12 +321,12 @@ private module ArrayDataFlow {
320321 }
321322
322323 /**
323- * A step for modeling that elements from an array `arr` also appear in the result from calling `slice`/`splice`/`filter`.
324+ * A step for modeling that elements from an array `arr` also appear in the result from calling `slice`/`splice`/`filter`/`toSpliced` .
324325 */
325326 private class ArraySliceStep extends PreCallGraphStep {
326327 override predicate loadStoreStep ( DataFlow:: Node pred , DataFlow:: SourceNode succ , string prop ) {
327328 exists ( DataFlow:: MethodCallNode call |
328- call .getMethodName ( ) = [ "slice" , "splice" , "filter" ] and
329+ call .getMethodName ( ) = [ "slice" , "splice" , "filter" , "toSpliced" ] and
329330 prop = arrayElement ( ) and
330331 pred = call .getReceiver ( ) and
331332 succ = call
0 commit comments