Skip to content

Commit

Permalink
Swift: Update expected test output
Browse files Browse the repository at this point in the history
  • Loading branch information
hvitved committed Dec 12, 2024
1 parent 63e1298 commit 52bb8d8
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ private import codeql.dataflow.internal.AccessPathSyntax as AccessPath
private import DataFlowImplSpecific as DataFlowImplSpecific
private import DataFlowImplSpecific::Private
private import DataFlowImplSpecific::Public
private import DataFlowImplCommon
private import codeql.swift.dataflow.ExternalFlow

module Input implements InputSig<Location, DataFlowImplSpecific::SwiftDataFlow> {
Expand Down
15 changes: 15 additions & 0 deletions swift/ql/test/library-tests/dataflow/dataflow/DataFlow.expected
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
edges
| file://:0:0:0:0 | .a [Reverse] [x] | file://:0:0:0:0 | self [Reverse] [a, x] | provenance | |
| file://:0:0:0:0 | .wrappedValue | test.swift:949:15:949:15 | x | provenance | |
| file://:0:0:0:0 | .wrappedValue | test.swift:951:15:951:15 | x | provenance | |
| file://:0:0:0:0 | KeyPathComponent [some:0] | test.swift:663:13:663:29 | exit #keyPath(...) [some:0] | provenance | |
Expand All @@ -10,6 +11,7 @@ edges
| file://:0:0:0:0 | [post] self [x, some:0] | test.swift:559:9:559:9 | self [Reverse] [x, some:0] | provenance | |
| file://:0:0:0:0 | [post] self [x] | test.swift:163:7:163:7 | self [Reverse] [x] | provenance | |
| file://:0:0:0:0 | [post] self [x] | test.swift:559:9:559:9 | self [Reverse] [x] | provenance | |
| file://:0:0:0:0 | self [Reverse] [a, x] | test.swift:185:7:185:7 | self [Reverse] [a, x] | provenance | |
| file://:0:0:0:0 | self [a, x] | file://:0:0:0:0 | .a [x] | provenance | |
| file://:0:0:0:0 | self [s, x] | file://:0:0:0:0 | .s [x] | provenance | |
| file://:0:0:0:0 | self [str] | file://:0:0:0:0 | .str | provenance | |
Expand Down Expand Up @@ -200,7 +202,10 @@ edges
| test.swift:181:13:181:13 | a [x] | test.swift:181:13:181:15 | .x | provenance | |
| test.swift:185:7:185:7 | self [a, x] | file://:0:0:0:0 | self [a, x] | provenance | |
| test.swift:194:3:194:3 | [post] b [a, x] | test.swift:195:13:195:13 | b [a, x] | provenance | |
| test.swift:194:3:194:5 | .a [Reverse] [x] | file://:0:0:0:0 | .a [Reverse] [x] | provenance | |
| test.swift:194:3:194:5 | .a [Reverse] [x] | test.swift:194:3:194:3 | [post] b [a, x] | provenance | |
| test.swift:194:3:194:5 | [post] getter for .a [x] | test.swift:194:3:194:3 | [post] b [a, x] | provenance | |
| test.swift:194:3:194:5 | [post] getter for .a [x] | test.swift:194:3:194:5 | .a [Reverse] [x] | provenance | |
| test.swift:194:11:194:18 | call to source() | test.swift:163:7:163:7 | value | provenance | |
| test.swift:194:11:194:18 | call to source() | test.swift:194:3:194:5 | [post] getter for .a [x] | provenance | |
| test.swift:195:13:195:13 | b [a, x] | test.swift:185:7:185:7 | self [a, x] | provenance | |
Expand All @@ -223,7 +228,10 @@ edges
| test.swift:213:13:213:13 | a [x] | test.swift:173:8:173:8 | self [x] | provenance | |
| test.swift:213:13:213:13 | a [x] | test.swift:213:13:213:19 | call to get() | provenance | |
| test.swift:218:3:218:3 | [post] b [a, x] | test.swift:219:13:219:13 | b [a, x] | provenance | |
| test.swift:218:3:218:5 | .a [Reverse] [x] | file://:0:0:0:0 | .a [Reverse] [x] | provenance | |
| test.swift:218:3:218:5 | .a [Reverse] [x] | test.swift:218:3:218:3 | [post] b [a, x] | provenance | |
| test.swift:218:3:218:5 | [post] getter for .a [x] | test.swift:218:3:218:3 | [post] b [a, x] | provenance | |
| test.swift:218:3:218:5 | [post] getter for .a [x] | test.swift:218:3:218:5 | .a [Reverse] [x] | provenance | |
| test.swift:218:11:218:18 | call to source() | test.swift:169:12:169:22 | value | provenance | |
| test.swift:218:11:218:18 | call to source() | test.swift:218:3:218:5 | [post] getter for .a [x] | provenance | |
| test.swift:219:13:219:13 | b [a, x] | test.swift:185:7:185:7 | self [a, x] | provenance | |
Expand Down Expand Up @@ -745,6 +753,7 @@ edges
| test.swift:988:34:988:34 | value | file://:0:0:0:0 | value | provenance | |
| test.swift:991:10:991:17 | call to source() | test.swift:988:34:988:34 | value | provenance | |
nodes
| file://:0:0:0:0 | .a [Reverse] [x] | semmle.label | .a [Reverse] [x] |
| file://:0:0:0:0 | .a [x] | semmle.label | .a [x] |
| file://:0:0:0:0 | .s [x] | semmle.label | .s [x] |
| file://:0:0:0:0 | .str | semmle.label | .str |
Expand All @@ -766,6 +775,7 @@ nodes
| file://:0:0:0:0 | [post] self [x, some:0] | semmle.label | [post] self [x, some:0] |
| file://:0:0:0:0 | [post] self [x] | semmle.label | [post] self [x] |
| file://:0:0:0:0 | [post] self [x] | semmle.label | [post] self [x] |
| file://:0:0:0:0 | self [Reverse] [a, x] | semmle.label | self [Reverse] [a, x] |
| file://:0:0:0:0 | self [a, x] | semmle.label | self [a, x] |
| file://:0:0:0:0 | self [s, x] | semmle.label | self [s, x] |
| file://:0:0:0:0 | self [str] | semmle.label | self [str] |
Expand Down Expand Up @@ -967,8 +977,10 @@ nodes
| test.swift:180:9:180:16 | call to source() | semmle.label | call to source() |
| test.swift:181:13:181:13 | a [x] | semmle.label | a [x] |
| test.swift:181:13:181:15 | .x | semmle.label | .x |
| test.swift:185:7:185:7 | self [Reverse] [a, x] | semmle.label | self [Reverse] [a, x] |
| test.swift:185:7:185:7 | self [a, x] | semmle.label | self [a, x] |
| test.swift:194:3:194:3 | [post] b [a, x] | semmle.label | [post] b [a, x] |
| test.swift:194:3:194:5 | .a [Reverse] [x] | semmle.label | .a [Reverse] [x] |
| test.swift:194:3:194:5 | [post] getter for .a [x] | semmle.label | [post] getter for .a [x] |
| test.swift:194:11:194:18 | call to source() | semmle.label | call to source() |
| test.swift:195:13:195:13 | b [a, x] | semmle.label | b [a, x] |
Expand All @@ -987,6 +999,7 @@ nodes
| test.swift:213:13:213:13 | a [x] | semmle.label | a [x] |
| test.swift:213:13:213:19 | call to get() | semmle.label | call to get() |
| test.swift:218:3:218:3 | [post] b [a, x] | semmle.label | [post] b [a, x] |
| test.swift:218:3:218:5 | .a [Reverse] [x] | semmle.label | .a [Reverse] [x] |
| test.swift:218:3:218:5 | [post] getter for .a [x] | semmle.label | [post] getter for .a [x] |
| test.swift:218:11:218:18 | call to source() | semmle.label | call to source() |
| test.swift:219:13:219:13 | b [a, x] | semmle.label | b [a, x] |
Expand Down Expand Up @@ -1553,6 +1566,7 @@ subpaths
| test.swift:174:12:174:12 | self [x] | test.swift:163:7:163:7 | self [x] | file://:0:0:0:0 | .x | test.swift:174:12:174:12 | .x |
| test.swift:180:9:180:16 | call to source() | test.swift:163:7:163:7 | value | test.swift:163:7:163:7 | self [Reverse] [x] | test.swift:180:3:180:3 | [post] a [x] |
| test.swift:181:13:181:13 | a [x] | test.swift:163:7:163:7 | self [x] | file://:0:0:0:0 | .x | test.swift:181:13:181:15 | .x |
| test.swift:194:3:194:5 | .a [Reverse] [x] | file://:0:0:0:0 | .a [Reverse] [x] | test.swift:185:7:185:7 | self [Reverse] [a, x] | test.swift:194:3:194:3 | [post] b [a, x] |
| test.swift:194:11:194:18 | call to source() | test.swift:163:7:163:7 | value | test.swift:163:7:163:7 | self [Reverse] [x] | test.swift:194:3:194:5 | [post] getter for .a [x] |
| test.swift:195:13:195:13 | b [a, x] | test.swift:185:7:185:7 | self [a, x] | file://:0:0:0:0 | .a [x] | test.swift:195:13:195:15 | .a [x] |
| test.swift:195:13:195:15 | .a [x] | test.swift:163:7:163:7 | self [x] | file://:0:0:0:0 | .x | test.swift:195:13:195:17 | .x |
Expand All @@ -1564,6 +1578,7 @@ subpaths
| test.swift:212:9:212:16 | call to source() | test.swift:169:12:169:22 | value | test.swift:169:3:171:3 | self[return] [x] | test.swift:212:3:212:3 | [post] a [x] |
| test.swift:212:9:212:16 | call to source() | test.swift:169:12:169:22 | value | test.swift:169:8:169:8 | self [Reverse] [x] | test.swift:212:3:212:3 | [post] a [x] |
| test.swift:213:13:213:13 | a [x] | test.swift:173:8:173:8 | self [x] | test.swift:174:12:174:12 | .x | test.swift:213:13:213:19 | call to get() |
| test.swift:218:3:218:5 | .a [Reverse] [x] | file://:0:0:0:0 | .a [Reverse] [x] | test.swift:185:7:185:7 | self [Reverse] [a, x] | test.swift:218:3:218:3 | [post] b [a, x] |
| test.swift:218:11:218:18 | call to source() | test.swift:169:12:169:22 | value | test.swift:169:3:171:3 | self[return] [x] | test.swift:218:3:218:5 | [post] getter for .a [x] |
| test.swift:218:11:218:18 | call to source() | test.swift:169:12:169:22 | value | test.swift:169:8:169:8 | self [Reverse] [x] | test.swift:218:3:218:5 | [post] getter for .a [x] |
| test.swift:219:13:219:13 | b [a, x] | test.swift:185:7:185:7 | self [a, x] | file://:0:0:0:0 | .a [x] | test.swift:219:13:219:15 | .a [x] |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,20 @@ edges
| SQLite.swift:197:17:197:49 | [...] [Collection element] | SQLite.swift:197:16:197:50 | [...] [Collection element, Collection element] | provenance | |
| SQLite.swift:197:18:197:32 | ... <-(_:_:) ... | SQLite.swift:197:17:197:49 | [...] [Collection element] | provenance | |
| SQLite.swift:197:32:197:32 | mobilePhoneNumber | SQLite.swift:197:18:197:32 | ... <-(_:_:) ... | provenance | |
| file://:0:0:0:0 | [post] self [data, Collection element] | testRealm2.swift:13:6:13:6 | self [Reverse] [data, Collection element] | provenance | |
| file://:0:0:0:0 | [post] self [data] | testRealm2.swift:13:6:13:6 | self [Reverse] [data] | provenance | |
| file://:0:0:0:0 | [post] self [data] | testRealm.swift:27:6:27:6 | self [Reverse] [data] | provenance | |
| file://:0:0:0:0 | [post] self [notStoredBankAccountNumber] | testCoreData2.swift:23:13:23:13 | self [Reverse] [notStoredBankAccountNumber] | provenance | |
| file://:0:0:0:0 | [post] self [password] | testRealm.swift:34:6:34:6 | self [Reverse] [password] | provenance | |
| file://:0:0:0:0 | [post] self [value] | testCoreData2.swift:70:9:70:9 | self [Reverse] [value] | provenance | |
| file://:0:0:0:0 | [post] self [data, Collection element] | file://:0:0:0:0 | self [Reverse] [data, Collection element] | provenance | |
| file://:0:0:0:0 | [post] self [data] | file://:0:0:0:0 | self [Reverse] [data] | provenance | |
| file://:0:0:0:0 | [post] self [data] | file://:0:0:0:0 | self [Reverse] [data] | provenance | |
| file://:0:0:0:0 | [post] self [notStoredBankAccountNumber] | file://:0:0:0:0 | self [Reverse] [notStoredBankAccountNumber] | provenance | |
| file://:0:0:0:0 | [post] self [password] | file://:0:0:0:0 | self [Reverse] [password] | provenance | |
| file://:0:0:0:0 | [post] self [value] | file://:0:0:0:0 | self [Reverse] [value] | provenance | |
| file://:0:0:0:0 | self | file://:0:0:0:0 | .value | provenance | Config |
| file://:0:0:0:0 | self | file://:0:0:0:0 | .value2 | provenance | Config |
| file://:0:0:0:0 | self [Reverse] [data, Collection element] | testRealm2.swift:13:6:13:6 | self [Reverse] [data, Collection element] | provenance | |
| file://:0:0:0:0 | self [Reverse] [data] | testRealm2.swift:13:6:13:6 | self [Reverse] [data] | provenance | |
| file://:0:0:0:0 | self [Reverse] [data] | testRealm.swift:27:6:27:6 | self [Reverse] [data] | provenance | |
| file://:0:0:0:0 | self [Reverse] [notStoredBankAccountNumber] | testCoreData2.swift:23:13:23:13 | self [Reverse] [notStoredBankAccountNumber] | provenance | |
| file://:0:0:0:0 | self [Reverse] [password] | testRealm.swift:34:6:34:6 | self [Reverse] [password] | provenance | |
| file://:0:0:0:0 | self [Reverse] [value] | testCoreData2.swift:70:9:70:9 | self [Reverse] [value] | provenance | |
| file://:0:0:0:0 | self [value] | file://:0:0:0:0 | .value | provenance | |
| file://:0:0:0:0 | value | file://:0:0:0:0 | [post] self [data] | provenance | |
| file://:0:0:0:0 | value | file://:0:0:0:0 | [post] self [data] | provenance | |
Expand Down Expand Up @@ -337,6 +343,12 @@ nodes
| file://:0:0:0:0 | [post] self [value] | semmle.label | [post] self [value] |
| file://:0:0:0:0 | self | semmle.label | self |
| file://:0:0:0:0 | self | semmle.label | self |
| file://:0:0:0:0 | self [Reverse] [data, Collection element] | semmle.label | self [Reverse] [data, Collection element] |
| file://:0:0:0:0 | self [Reverse] [data] | semmle.label | self [Reverse] [data] |
| file://:0:0:0:0 | self [Reverse] [data] | semmle.label | self [Reverse] [data] |
| file://:0:0:0:0 | self [Reverse] [notStoredBankAccountNumber] | semmle.label | self [Reverse] [notStoredBankAccountNumber] |
| file://:0:0:0:0 | self [Reverse] [password] | semmle.label | self [Reverse] [password] |
| file://:0:0:0:0 | self [Reverse] [value] | semmle.label | self [Reverse] [value] |
| file://:0:0:0:0 | self [value] | semmle.label | self [value] |
| file://:0:0:0:0 | value | semmle.label | value |
| file://:0:0:0:0 | value | semmle.label | value |
Expand Down
10 changes: 10 additions & 0 deletions swift/ql/test/query-tests/Security/CWE-757/InsecureTLS.expected
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@ edges
| InsecureTLS.swift:187:42:187:42 | withMinVersion | InsecureTLS.swift:187:5:187:5 | [post] self | provenance | |
| InsecureTLS.swift:193:51:193:74 | .TLSv10 | InsecureTLS.swift:185:20:185:36 | withMinVersion | provenance | |
| InsecureTLS.swift:196:56:196:63 | value | InsecureTLS.swift:196:1:198:1 | version[return] | provenance | |
| InsecureTLS.swift:202:24:202:31 | .tlsMinimumSupportedProtocolVersion [Reverse] | InsecureTLS.swift:202:24:202:24 | [post] config | provenance | |
| InsecureTLS.swift:202:24:202:31 | .tlsMinimumSupportedProtocolVersion [Reverse] | file://:0:0:0:0 | .tlsMinimumSupportedProtocolVersion [Reverse] | provenance | |
| InsecureTLS.swift:202:24:202:31 | [post] getter for .tlsMinimumSupportedProtocolVersion | InsecureTLS.swift:202:24:202:24 | [post] config | provenance | |
| InsecureTLS.swift:202:24:202:31 | [post] getter for .tlsMinimumSupportedProtocolVersion | InsecureTLS.swift:202:24:202:31 | .tlsMinimumSupportedProtocolVersion [Reverse] | provenance | |
| InsecureTLS.swift:202:74:202:97 | .TLSv10 | InsecureTLS.swift:196:56:196:63 | value | provenance | |
| InsecureTLS.swift:202:74:202:97 | .TLSv10 | InsecureTLS.swift:202:24:202:31 | [post] getter for .tlsMinimumSupportedProtocolVersion | provenance | |
| file://:0:0:0:0 | .tlsMinimumSupportedProtocolVersion [Reverse] | file://:0:0:0:0 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | provenance | |
| file://:0:0:0:0 | [post] self [TLSVersion] | InsecureTLS.swift:158:7:158:7 | self [Reverse] [TLSVersion] | provenance | |
| file://:0:0:0:0 | [post] self [tlsMaximumSupportedProtocolVersion] | InsecureTLS.swift:20:7:20:7 | self [Reverse] [tlsMaximumSupportedProtocolVersion] | provenance | |
| file://:0:0:0:0 | [post] self [tlsMaximumSupportedProtocol] | InsecureTLS.swift:23:7:23:7 | self [Reverse] [tlsMaximumSupportedProtocol] | provenance | |
| file://:0:0:0:0 | [post] self [tlsMinimumSupportedProtocolVersion] | InsecureTLS.swift:19:7:19:7 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | provenance | |
| file://:0:0:0:0 | [post] self [tlsMinimumSupportedProtocol] | InsecureTLS.swift:22:7:22:7 | self [Reverse] [tlsMinimumSupportedProtocol] | provenance | |
| file://:0:0:0:0 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | InsecureTLS.swift:19:7:19:7 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | provenance | |
| file://:0:0:0:0 | self [TLSVersion] | file://:0:0:0:0 | .TLSVersion | provenance | |
| file://:0:0:0:0 | value | file://:0:0:0:0 | [post] self | provenance | |
| file://:0:0:0:0 | value | file://:0:0:0:0 | [post] self | provenance | |
Expand All @@ -55,6 +60,7 @@ edges
| file://:0:0:0:0 | value | file://:0:0:0:0 | [post] self [tlsMinimumSupportedProtocol] | provenance | |
nodes
| InsecureTLS.swift:19:7:19:7 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | semmle.label | self [Reverse] [tlsMinimumSupportedProtocolVersion] |
| InsecureTLS.swift:19:7:19:7 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | semmle.label | self [Reverse] [tlsMinimumSupportedProtocolVersion] |
| InsecureTLS.swift:19:7:19:7 | value | semmle.label | value |
| InsecureTLS.swift:20:7:20:7 | self [Reverse] [tlsMaximumSupportedProtocolVersion] | semmle.label | self [Reverse] [tlsMaximumSupportedProtocolVersion] |
| InsecureTLS.swift:20:7:20:7 | value | semmle.label | value |
Expand Down Expand Up @@ -96,9 +102,11 @@ nodes
| InsecureTLS.swift:196:1:198:1 | version[return] | semmle.label | version[return] |
| InsecureTLS.swift:196:56:196:63 | value | semmle.label | value |
| InsecureTLS.swift:202:24:202:24 | [post] config | semmle.label | [post] config |
| InsecureTLS.swift:202:24:202:31 | .tlsMinimumSupportedProtocolVersion [Reverse] | semmle.label | .tlsMinimumSupportedProtocolVersion [Reverse] |
| InsecureTLS.swift:202:24:202:31 | [post] getter for .tlsMinimumSupportedProtocolVersion | semmle.label | [post] getter for .tlsMinimumSupportedProtocolVersion |
| InsecureTLS.swift:202:74:202:97 | .TLSv10 | semmle.label | .TLSv10 |
| file://:0:0:0:0 | .TLSVersion | semmle.label | .TLSVersion |
| file://:0:0:0:0 | .tlsMinimumSupportedProtocolVersion [Reverse] | semmle.label | .tlsMinimumSupportedProtocolVersion [Reverse] |
| file://:0:0:0:0 | [post] self | semmle.label | [post] self |
| file://:0:0:0:0 | [post] self | semmle.label | [post] self |
| file://:0:0:0:0 | [post] self | semmle.label | [post] self |
Expand All @@ -108,6 +116,7 @@ nodes
| file://:0:0:0:0 | [post] self [tlsMaximumSupportedProtocol] | semmle.label | [post] self [tlsMaximumSupportedProtocol] |
| file://:0:0:0:0 | [post] self [tlsMinimumSupportedProtocolVersion] | semmle.label | [post] self [tlsMinimumSupportedProtocolVersion] |
| file://:0:0:0:0 | [post] self [tlsMinimumSupportedProtocol] | semmle.label | [post] self [tlsMinimumSupportedProtocol] |
| file://:0:0:0:0 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | semmle.label | self [Reverse] [tlsMinimumSupportedProtocolVersion] |
| file://:0:0:0:0 | self [TLSVersion] | semmle.label | self [TLSVersion] |
| file://:0:0:0:0 | value | semmle.label | value |
| file://:0:0:0:0 | value | semmle.label | value |
Expand All @@ -126,6 +135,7 @@ subpaths
| InsecureTLS.swift:165:47:165:47 | def [TLSVersion] | InsecureTLS.swift:158:7:158:7 | self [TLSVersion] | file://:0:0:0:0 | .TLSVersion | InsecureTLS.swift:165:47:165:51 | .TLSVersion |
| InsecureTLS.swift:165:47:165:51 | .TLSVersion | InsecureTLS.swift:19:7:19:7 | value | InsecureTLS.swift:19:7:19:7 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | InsecureTLS.swift:165:3:165:3 | [post] config |
| InsecureTLS.swift:181:53:181:76 | .TLSv10 | InsecureTLS.swift:19:7:19:7 | value | InsecureTLS.swift:19:7:19:7 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | InsecureTLS.swift:181:3:181:9 | [post] getter for .config |
| InsecureTLS.swift:202:24:202:31 | .tlsMinimumSupportedProtocolVersion [Reverse] | file://:0:0:0:0 | .tlsMinimumSupportedProtocolVersion [Reverse] | InsecureTLS.swift:19:7:19:7 | self [Reverse] [tlsMinimumSupportedProtocolVersion] | InsecureTLS.swift:202:24:202:24 | [post] config |
| InsecureTLS.swift:202:74:202:97 | .TLSv10 | InsecureTLS.swift:196:56:196:63 | value | InsecureTLS.swift:196:1:198:1 | version[return] | InsecureTLS.swift:202:24:202:31 | [post] getter for .tlsMinimumSupportedProtocolVersion |
#select
| InsecureTLS.swift:40:3:40:3 | [post] config | InsecureTLS.swift:40:47:40:70 | .TLSv10 | InsecureTLS.swift:40:3:40:3 | [post] config | This TLS configuration is insecure. |
Expand Down

0 comments on commit 52bb8d8

Please sign in to comment.