Skip to content

Commit 4c9f406

Browse files
committed
JS: Exclude some sinks in UnvalidatedDynamicMethodCall
1 parent 7e4fbe2 commit 4c9f406

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

javascript/ql/lib/semmle/javascript/security/dataflow/UnvalidatedDynamicMethodCallCustomizations.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ module UnvalidatedDynamicMethodCall {
182182
exists(InvokeExpr invk |
183183
this = invk.getCallee().flow() and
184184
// don't flag invocations inside a try-catch
185-
not invk.getASuccessor() instanceof CatchClause
185+
not invk.getASuccessor() instanceof CatchClause and
186+
// Filter out `foo.bar()` calls as they usually aren't interesting.
187+
// Technically this could be reachable if preceded by `foo.bar = obj[taint]`
188+
// but such sinks are more likely to be FPs and also slow down the query.
189+
not invk.getCallee() instanceof DotExpr
186190
)
187191
}
188192

0 commit comments

Comments
 (0)