File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,18 @@ module ArrayTaintTracking {
3636 succ = call
3737 )
3838 or
39- // `array.filter(x => x)` keeps the taint
39+ // `array.filter(x => x)` and `array.filter(x => !!x)` keeps the taint
4040 call .( DataFlow:: MethodCallNode ) .getMethodName ( ) = "filter" and
4141 pred = call .getReceiver ( ) and
4242 succ = call and
43- exists ( DataFlow:: FunctionNode callback | callback = call .getArgument ( 0 ) .getAFunctionValue ( ) |
44- callback .getParameter ( 0 ) .getALocalUse ( ) = callback .getAReturn ( )
43+ exists ( DataFlow:: FunctionNode callback , DataFlow:: Node param , DataFlow:: Node ret |
44+ callback = call .getArgument ( 0 ) .getAFunctionValue ( ) and
45+ param = callback .getParameter ( 0 ) .getALocalUse ( ) and
46+ ret = callback .getAReturn ( )
47+ |
48+ param = ret
49+ or
50+ param = DataFlow:: exprNode ( ret .asExpr ( ) .( LogNotExpr ) .getOperand ( ) .( LogNotExpr ) .getOperand ( ) )
4551 )
4652 or
4753 // `array.reduce` with tainted value in callback
You can’t perform that action at this time.
0 commit comments