Skip to content

Commit bf5e9d7

Browse files
committed
Support Connection.Location.uri sink
1 parent 832173a commit bf5e9d7

5 files changed

Lines changed: 77 additions & 61 deletions

File tree

‎unified/ql/lib/ext/legacy-swift.model.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ extensions:
235235
- ["", "Connection", true, "scalar(_:_:)", "", "", "Argument[0]", "database-store", "manual"]
236236
- ["", "Connection", true, "scalar(_:_:)", "", "", "Argument[1]", "database-store", "manual"]
237237
- ["", "Connection", true, "init(_:readonly:)", "", "", "Argument[0]", "path-injection", "manual"]
238+
- ["", "Connection.Location", true, "uri(_:parameters:)", "", "", "Argument[0]", "path-injection", "manual"]
238239
- ["", "Database", true, "changePassphrase(_:)", "", "", "Argument[0]", "encryption-key", "manual"]
239240
- ["", "Database", true, "usePassphrase(_:)", "", "", "Argument[0]", "encryption-key", "manual"]
240241
- ["", "Database", true, "allStatements(arguments:sql:)", "", "", "Argument[arguments:]", "database-store", "manual"]

‎unified/ql/test/library-tests/mad/test.expected‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ isSink
1515
| test.swift:100:24:100:36 | encryptionKey | encryption-key |
1616
| test.swift:101:18:101:24 | fileURL | path-injection |
1717
| test.swift:107:23:107:34 | seedFilePath | path-injection |
18+
| test.swift:119:29:119:34 | string | path-injection |
1819
isSource
1920
| test.swift:4:5:4:27 | String(...) | remote |
2021
| test.swift:5:5:5:44 | String(...) | remote |

‎unified/ql/test/library-tests/mad/test.swift‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,13 @@ func testQualifiedConstructors(
108108
shouldCompactOnLaunch: nil,
109109
syncConfiguration: nil)
110110
}
111+
112+
class Connection {
113+
enum Location {
114+
static func uri(_ path: String, parameters: String) {}
115+
}
116+
}
117+
118+
func testConnectionLocation(string: String) {
119+
Connection.Location.uri(string, parameters: "") // $ isSink=path-injection
120+
}

0 commit comments

Comments
 (0)