Skip to content

Commit 34e6864

Browse files
committed
JS: Note issue with .apply() calls
1 parent ac1dd18 commit 34e6864

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

javascript/ql/lib/semmle/javascript/dataflow/internal/TaintTrackingPrivate.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ predicate defaultAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2)
2525
node1 = TValueNode(invoke.getAnArgument().stripParens().(SpreadElement).getOperand()) and
2626
node2 = TDynamicArgumentStoreNode(invoke, c) and
2727
c.isUnknownArrayElement()
28+
// TODO: we need a similar case for .apply() calls
2829
)
2930
}
3031

javascript/ql/test/library-tests/TaintTracking/array-mutation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ function test(x, y) {
2929

3030
let h = [];
3131
Array.prototype.push.apply(h, source());
32-
sink(h); // NOT OK
32+
sink(h); // NOT OK [INCONSISTENCY]
3333

3434
let i = [];
3535
Array.prototype.unshift.apply(i, source());
36-
sink(i); // NOT OK
36+
sink(i); // NOT OK [INCONSISTENCY]
3737

3838
let j = [];
3939
j[j.length] = source();

0 commit comments

Comments
 (0)