File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
swift/ql/lib/codeql/swift/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 @@ -99,3 +99,29 @@ private module Cached {
9999}
100100
101101import Cached
102+ import SpeculativeTaintFlow
103+
104+ private module SpeculativeTaintFlow {
105+ private import codeql.swift.dataflow.internal.DataFlowDispatch as DataFlowDispatch
106+ private import codeql.swift.dataflow.internal.DataFlowPublic as DataFlowPublic
107+ private import codeql.swift.dataflow.internal.DataFlowPrivate as DataFlowPrivate
108+
109+ predicate speculativeTaintStep ( DataFlow:: Node src , DataFlow:: Node sink ) {
110+ exists ( DataFlowDispatch:: DataFlowCall call , DataFlowDispatch:: ArgumentPosition argpos |
111+ // TODO: exclude neutrals and anything that has QL modeling.
112+ not exists ( DataFlowDispatch:: viableCallable ( call ) ) and
113+ src .( DataFlowPrivate:: ArgumentNode ) .argumentOf ( call , argpos )
114+ |
115+ not argpos instanceof DataFlowDispatch:: ThisArgumentPosition and
116+ sink .( DataFlowPublic:: PostUpdateNode )
117+ .getPreUpdateNode ( )
118+ .( DataFlowPrivate:: ArgumentNode )
119+ .argumentOf ( call ,
120+ any ( DataFlowDispatch:: ArgumentPosition qualpos |
121+ qualpos instanceof DataFlowDispatch:: ThisArgumentPosition
122+ ) )
123+ or
124+ sink .( DataFlowPrivate:: OutNode ) .getCall ( _) = call
125+ )
126+ }
127+ }
You can’t perform that action at this time.
0 commit comments