mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Merge pull request #15893 from erik-krogh/more-filter-taint
JS: allow more flow through .filter()
This commit is contained in:
@@ -36,7 +36,8 @@ module ArrayTaintTracking {
|
||||
succ = call
|
||||
)
|
||||
or
|
||||
// `array.filter(x => x)` and `array.filter(x => !!x)` keeps the taint
|
||||
// `array.filter(x => x)` and `array.filter(x => !<something>)` keeps the taint
|
||||
// the latter is assumed to filter away only specific values, thus keeping the taint
|
||||
call.(DataFlow::MethodCallNode).getMethodName() = "filter" and
|
||||
pred = call.getReceiver() and
|
||||
succ = call and
|
||||
@@ -47,7 +48,7 @@ module ArrayTaintTracking {
|
||||
|
|
||||
param = ret
|
||||
or
|
||||
param = DataFlow::exprNode(ret.asExpr().(LogNotExpr).getOperand().(LogNotExpr).getOperand())
|
||||
ret.asExpr() instanceof LogNotExpr
|
||||
)
|
||||
or
|
||||
// `array.reduce` with tainted value in callback
|
||||
|
||||
Reference in New Issue
Block a user