mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
JS: Add: dataflow step for static method of groupBy from Map.
This commit is contained in:
@@ -160,7 +160,22 @@ private module CollectionDataFlow {
|
||||
exists(DataFlow::MethodCallNode call |
|
||||
call = DataFlow::globalVarRef(["Map", "Object"]).getAMemberCall("groupBy") and
|
||||
pred = call.getArgument(0) and
|
||||
succ = call
|
||||
(succ = call.getCallback(1).getParameter(0) or succ = call.getALocalUse())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A step for handling data flow and taint tracking for the groupBy method on iterable objects.
|
||||
* Ensures propagation of taint and data flow through the groupBy operation.
|
||||
*/
|
||||
private class GroupByDataFlowStep extends PreCallGraphStep {
|
||||
override predicate storeStep(DataFlow::Node pred, DataFlow::SourceNode succ, string prop) {
|
||||
exists(DataFlow::MethodCallNode call |
|
||||
call = DataFlow::globalVarRef("Map").getAMemberCall("groupBy") and
|
||||
pred = call.getArgument(0) and
|
||||
succ = call and
|
||||
prop = mapValueUnknownKey()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user