Skip to content

Commit f587273

Browse files
authored
Merge pull request #19768 from trailofbits/VF/lodash-group-by
Add lodash GroupBy as taint step
2 parents c375f24 + 26f3b40 commit f587273

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

javascript/ql/lib/semmle/javascript/frameworks/LodashUnderscore.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,18 @@ module LodashUnderscore {
341341
preservesValue = true
342342
}
343343
}
344+
345+
private class LodashGroupBy extends DataFlow::SummarizedCallable {
346+
LodashGroupBy() { this = "_.groupBy" }
347+
348+
override DataFlow::CallNode getACall() { result = member("groupBy").getACall() }
349+
350+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
351+
input = "Argument[0]" and
352+
output = ["Argument[1].Parameter[0]", "ReturnValue"] and
353+
preservesValue = false
354+
}
355+
}
344356
}
345357

346358
/**

0 commit comments

Comments
 (0)