Skip to content

Commit 03070c9

Browse files
committed
Ruby: restrict AccessLocalsKeySummary to method calls against self
1 parent f6516db commit 03070c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ruby/ql/lib/codeql/ruby/frameworks/Rails.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ private class AccessLocalsKeySummary extends SummarizedCallable {
365365

366366
override MethodCall getACall() {
367367
result.getLocation().getFile() = glob.getErbFile() and
368-
result.getMethodName() = methodName
368+
result.getMethodName() = methodName and
369+
result.getReceiver() instanceof SelfVariableReadAccess
369370
}
370371

371372
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {

0 commit comments

Comments
 (0)