@@ -77,8 +77,8 @@ module ArrayTaintTracking {
7777 succ = call .getReceiver ( ) .getALocalSource ( ) and
7878 call .getCalleeName ( ) = [ "push" , "unshift" ]
7979 or
80- // `array.splice(i, del, e )`: if `e` is tainted, then so is `array`.
81- pred = call .getArgument ( 2 ) and
80+ // `array.splice(i, del, ...items )`: if any item is tainted, then so is `array`.
81+ pred = call .getArgument ( any ( int i | i >= 2 ) ) and
8282 succ .( DataFlow:: SourceNode ) .getAMethodCall ( "splice" ) = call
8383 or
8484 // `e = array.pop()`, `e = array.shift()`, or similar: if `array` is tainted, then so is `e`.
@@ -274,14 +274,14 @@ private module ArrayDataFlow {
274274
275275 /**
276276 * A step modeling that `splice` can insert elements into an array.
277- * For example in `array.splice(i, del, e )`: if `e` is tainted, then so is `array
277+ * For example in `array.splice(i, del, ...items )`: if any item is tainted, then so is `array`
278278 */
279279 private class ArraySpliceStep extends PreCallGraphStep {
280280 override predicate storeStep ( DataFlow:: Node element , DataFlow:: SourceNode obj , string prop ) {
281281 exists ( DataFlow:: MethodCallNode call |
282282 call .getMethodName ( ) = "splice" and
283283 prop = arrayElement ( ) and
284- element = call .getArgument ( 2 ) and
284+ element = call .getArgument ( any ( int i | i >= 2 ) ) and
285285 call = obj .getAMethodCall ( )
286286 )
287287 }
0 commit comments