Skip to content

Commit e09e64e

Browse files
committed
Swift: Restrict taint flow through + to strings.
1 parent f3499e9 commit e09e64e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ private module Cached {
4343
)
4444
or
4545
// allow flow through string concatenation.
46-
nodeTo.asExpr().(AddExpr).getAnOperand() = nodeFrom.asExpr()
46+
exists(AddExpr ae |
47+
ae.getAnOperand() = nodeFrom.asExpr() and
48+
ae = nodeTo.asExpr() and
49+
ae.getType().getName() = "String"
50+
)
4751
or
4852
// allow flow through `URL.init`.
4953
exists(CallExpr call, ClassDecl c, AbstractFunctionDecl f |

0 commit comments

Comments
 (0)