File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
ruby/ql/lib/codeql/ruby/dataflow/internal Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -149,3 +149,29 @@ private module Cached {
149149}
150150
151151import Cached
152+ import SpeculativeTaintFlow
153+
154+ private module SpeculativeTaintFlow {
155+ private import codeql.ruby.dataflow.internal.DataFlowDispatch as DataFlowDispatch
156+ private import codeql.ruby.dataflow.internal.DataFlowPublic as DataFlowPublic
157+
158+ predicate speculativeTaintStep ( DataFlow:: Node src , DataFlow:: Node sink ) {
159+ exists (
160+ DataFlowDispatch:: DataFlowCall call , MethodCall srcCall ,
161+ DataFlowDispatch:: ArgumentPosition argpos
162+ |
163+ // TODO: exclude neutrals and anything that has QL modeling.
164+ not exists ( DataFlowDispatch:: viableCallable ( call ) ) and
165+ call .asCall ( ) .getExpr ( ) = srcCall and
166+ src .( ArgumentNode ) .argumentOf ( call , argpos )
167+ |
168+ not argpos .isSelf ( ) and
169+ sink .( DataFlowPublic:: PostUpdateNode )
170+ .getPreUpdateNode ( )
171+ .( ArgumentNode )
172+ .argumentOf ( call , any ( DataFlowDispatch:: ArgumentPosition qualpos | qualpos .isSelf ( ) ) )
173+ or
174+ sink .( OutNode ) .getCall ( _) = call
175+ )
176+ }
177+ }
You can’t perform that action at this time.
0 commit comments