We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.filter
1 parent ab53f3b commit 4ac21e9Copy full SHA for 4ac21e9
javascript/ql/src/semmle/javascript/Arrays.qll
@@ -36,10 +36,13 @@ module ArrayTaintTracking {
36
succ = call
37
)
38
or
39
- // `array.filter` keeps the taint
+ // `array.filter(x => x)` keeps the taint
40
call.(DataFlow::MethodCallNode).getMethodName() = "filter" and
41
pred = call.getReceiver() and
42
- succ = call
+ succ = call and
43
+ exists(DataFlow::FunctionNode callback | callback = call.getArgument(0).getAFunctionValue() |
44
+ callback.getParameter(0).getALocalUse() = callback.getAReturn()
45
+ )
46
47
// `array.reduce` with tainted value in callback
48
call.(DataFlow::MethodCallNode).getMethodName() = "reduce" and
0 commit comments