From 09c7329488f585c7eac1e2055159f0d0358817bd Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Tue, 23 Jun 2026 20:23:00 +0100 Subject: [PATCH] Ruby: Fixes after changes to the flow summary API. --- .../lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll | 3 +-- .../lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll | 6 ++++++ .../codeql/ruby/dataflow/internal/TaintTrackingPrivate.qll | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll index 9646592c0c2..9f3042ebb5b 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll @@ -198,8 +198,7 @@ module LocalFlow { FlowSummaryNode nodeFrom, FlowSummaryNode nodeTo, FlowSummaryImpl::Public::SummarizedCallable c, string model ) { - FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom.getSummaryNode(), - nodeTo.getSummaryNode(), true, model) and + FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom, nodeTo.getSummaryNode(), true, model) and c = nodeFrom.getSummarizedCallable() } diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll index d7326d9594b..d94bba89bf5 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll @@ -18,6 +18,8 @@ module Input implements InputSig { class SinkBase = Void; + class FlowSummaryCallBase = Void; + predicate callableFromSource(SummarizedCallableBase c) { none() } ArgumentPosition callbackSelfParameterPosition() { result.isLambdaSelf() } @@ -157,6 +159,10 @@ module Input implements InputSig { private import Make as Impl private module StepsInput implements Impl::Private::StepsInputSig { + Impl::Private::SummaryNode getSummaryNode(Node n) { + result = n.(FlowSummaryNode).getSummaryNode() + } + DataFlowCall getACall(Public::SummarizedCallable sc) { result.asCall().getAstNode() = sc.(LibraryCallable).getACall() or diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/TaintTrackingPrivate.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/TaintTrackingPrivate.qll index 104ef68c267..a41f7c92482 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/TaintTrackingPrivate.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/TaintTrackingPrivate.qll @@ -109,7 +109,7 @@ private module Cached { ) and model = "" or - FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom.(FlowSummaryNode).getSummaryNode(), + FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom, nodeTo.(FlowSummaryNode).getSummaryNode(), false, model) or any(FlowSteps::AdditionalTaintStep s).step(nodeFrom, nodeTo) and model = "AdditionalTaintStep"