Skip to content

Commit 166902b

Browse files
committed
Swift: Remove the special case for bitwise operations in the XXE query (but upgrade that bit of the query to taint flow as appears to be intended).
1 parent 1f8a165 commit 166902b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

swift/ql/lib/codeql/swift/security/XXEExtensions.qll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import swift
44
private import codeql.swift.dataflow.DataFlow
5+
private import codeql.swift.dataflow.TaintTracking
56
private import codeql.swift.frameworks.AEXML
67
private import codeql.swift.frameworks.Libxml2
78
private import codeql.swift.dataflow.ExternalFlow
@@ -182,9 +183,7 @@ private class Libxml2XxeSink extends XxeSink {
182183
* including bitwise operations, accesses to `.rawValue`, and casts to `Int32`.
183184
*/
184185
private predicate lib2xmlOptionLocalTaintStep(DataFlow::Node source, DataFlow::Node sink) {
185-
DataFlow::localFlowStep(source, sink)
186-
or
187-
source.asExpr() = sink.asExpr().(BitwiseOperation).getAnOperand()
186+
TaintTracking::localTaintStep(source, sink)
188187
or
189188
exists(MemberRefExpr rawValue | rawValue.getMember().(VarDecl).getName() = "rawValue" |
190189
source.asExpr() = rawValue.getBase() and sink.asExpr() = rawValue

0 commit comments

Comments
 (0)