Skip to content

Commit bfbd45a

Browse files
committed
Swift: Fix CSV field sinks.
1 parent d317ad8 commit bfbd45a

File tree

3 files changed

+183
-2
lines changed

3 files changed

+183
-2
lines changed

swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,17 @@ predicate interpretOutputSpecific(string c, InterpretNode mid, InterpretNode nod
199199
)
200200
}
201201

202-
predicate interpretInputSpecific(string c, InterpretNode mid, InterpretNode n) { none() }
202+
predicate interpretInputSpecific(string c, InterpretNode mid, InterpretNode node) {
203+
// Allow fields to be picked as input nodes.
204+
exists(Node n, AstNode ast, MemberRefExpr e |
205+
n = node.asNode() and
206+
ast = mid.asElement()
207+
|
208+
c = "" and
209+
e.getBase() = n.asExpr() and
210+
e.getMember() = ast
211+
)
212+
}
203213

204214
/** Gets the argument position obtained by parsing `X` in `Parameter[X]`. */
205215
bindingset[s]

0 commit comments

Comments
 (0)