Skip to content

Commit 42d35f8

Browse files
committed
Ruby: Exclude some cases that are unlikely library calls.
1 parent c20f12f commit 42d35f8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ruby/ql/lib/codeql/ruby/dataflow/internal/TaintTrackingPrivate.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,16 @@ private module SpeculativeTaintFlow {
162162
predicate speculativeTaintStep(DataFlow::Node src, DataFlow::Node sink) {
163163
exists(
164164
DataFlowDispatch::DataFlowCall call, MethodCall srcCall,
165-
DataFlowDispatch::ArgumentPosition argpos
165+
DataFlowDispatch::ArgumentPosition argpos, MethodCall mc
166166
|
167167
// TODO: exclude neutrals and anything that has QL modeling.
168168
not exists(DataFlowDispatch::viableCallable(call)) and
169169
call.asCall().getExpr() = srcCall and
170-
src.(ArgumentNode).argumentOf(call, argpos)
170+
src.(ArgumentNode).argumentOf(call, argpos) and
171+
call.asCall().getExpr() = mc and
172+
not mc instanceof Operation and
173+
not mc instanceof SetterMethodCall and
174+
not mc instanceof ElementReference
171175
|
172176
not argpos.isSelf() and
173177
sink.(DataFlowPublic::PostUpdateNode)

0 commit comments

Comments
 (0)