Skip to content

Commit 4d3fc02

Browse files
authored
Merge pull request github#11965 from geoffw0/realmfix
Swift: Test and fix missing swift/cleartext-storage-database results
2 parents 53de9ae + 7f69fe6 commit 4d3fc02

File tree

10 files changed

+103
-56
lines changed

10 files changed

+103
-56
lines changed

swift/ql/lib/codeql/swift/elements/type/NominalType.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ private import codeql.swift.elements.decl.NominalTypeDecl
33
private import codeql.swift.elements.type.Type
44

55
class NominalType extends Generated::NominalType {
6-
Type getABaseType() { result = this.getDeclaration().(NominalTypeDecl).getABaseType() }
6+
override Type getABaseType() { result = this.getDeclaration().(NominalTypeDecl).getABaseType() }
77

88
NominalType getADerivedType() { result.getABaseType() = this }
99

swift/ql/lib/codeql/swift/elements/type/Type.qll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,18 @@ class Type extends Generated::Type {
1111
* ```
1212
*/
1313
Type getUnderlyingType() { result = this }
14+
15+
/**
16+
* Gets any base type of this type. For a `typealias`, this is a base type
17+
* of the aliased type. For example in the following code, both `B` and
18+
* `B_alias` have base type `A`.
19+
* ```
20+
* class A {}
21+
*
22+
* class B : A {}
23+
*
24+
* typealias B_alias = B
25+
* ```
26+
*/
27+
Type getABaseType() { none() }
1428
}

swift/ql/lib/codeql/swift/elements/type/TypeAliasType.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ class TypeAliasType extends Generated::TypeAliasType {
1313
Type getAliasedType() { result = this.getDecl().getAliasedType() }
1414

1515
override Type getUnderlyingType() { result = this.getAliasedType().getUnderlyingType() }
16+
17+
override Type getABaseType() { result = this.getAliasedType().getABaseType() }
1618
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private class CoreDataStore extends CleartextStorageDatabaseSink {
4949
// with `coreDataObj.data` is a sink.
5050
// (ideally this would be only members with the `@NSManaged` attribute)
5151
exists(NominalType t, Expr e |
52-
t.getABaseType*().getName() = "NSManagedObject" and
52+
t.getABaseType*().getUnderlyingType().getName() = "NSManagedObject" and
5353
this.(DataFlow::PostUpdateNode).getPreUpdateNode().asExpr() = e and
5454
e.getFullyConverted().getType() = t and
5555
not e.(DeclRefExpr).getDecl() instanceof SelfParamDecl
@@ -67,7 +67,7 @@ private class RealmStore extends CleartextStorageDatabaseSink instanceof DataFlo
6767
// example in `realmObj.data = sensitive` the post-update node corresponding
6868
// with `realmObj.data` is a sink.
6969
exists(NominalType t, Expr e |
70-
t.getABaseType*().getName() = "RealmSwiftObject" and
70+
t.getABaseType*().getUnderlyingType().getName() = "RealmSwiftObject" and
7171
this.getPreUpdateNode().asExpr() = e and
7272
e.getFullyConverted().getType() = t and
7373
not e.(DeclRefExpr).getDecl() instanceof SelfParamDecl

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ class CleartextStorageConfig extends TaintTracking::Configuration {
3737
// flow out from fields of an `NSManagedObject` or `RealmSwiftObject` at the sink,
3838
// for example in `realmObj.data = sensitive`.
3939
isSink(node) and
40-
exists(ClassOrStructDecl cd, Decl cx |
41-
cd.getABaseTypeDecl*().getName() = ["NSManagedObject", "RealmSwiftObject"] and
42-
cx.asNominalTypeDecl() = cd and
40+
exists(NominalTypeDecl d, Decl cx |
41+
d.getType().getABaseType*().getUnderlyingType().getName() =
42+
["NSManagedObject", "RealmSwiftObject"] and
43+
cx.asNominalTypeDecl() = d and
4344
c.getAReadContent().(DataFlow::Content::FieldContent).getField() = cx.getAMember()
4445
)
4546
or

swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
| nominaltype.swift:37:6:37:6 | a_optional_alias | A_optional_alias | A? | getAliasedType:A? |
44
| nominaltype.swift:38:6:38:6 | b1 | B1 | B1 | getABaseType:A |
55
| nominaltype.swift:39:6:39:6 | b2 | B2 | B2 | getABaseType:A_alias |
6-
| nominaltype.swift:40:6:40:6 | b1_alias | B1_alias | B1 | getAliasedType:B1 |
7-
| nominaltype.swift:41:6:41:6 | b2_alias | B2_alias | B2 | getAliasedType:B2 |
6+
| nominaltype.swift:40:6:40:6 | b1_alias | B1_alias | B1 | getABaseType:A, getAliasedType:B1 |
7+
| nominaltype.swift:41:6:41:6 | b2_alias | B2_alias | B2 | getABaseType:A_alias, getAliasedType:B2 |
88
| nominaltype.swift:42:6:42:6 | p | P | P | |
99
| nominaltype.swift:43:6:43:6 | p_alias | P_alias | P_alias | |
1010
| nominaltype.swift:44:6:44:6 | c1 | C1 | C1 | getABaseType:P |
1111
| nominaltype.swift:45:6:45:6 | c2 | C2 | C2 | getABaseType:P_alias |
12-
| nominaltype.swift:46:6:46:6 | c1_alias | C1_alias | C1 | getAliasedType:C1 |
13-
| nominaltype.swift:47:6:47:6 | c2_alias | C2_alias | C2 | getAliasedType:C2 |
12+
| nominaltype.swift:46:6:46:6 | c1_alias | C1_alias | C1 | getABaseType:P, getAliasedType:C1 |
13+
| nominaltype.swift:47:6:47:6 | c2_alias | C2_alias | C2 | getABaseType:P_alias, getAliasedType:C2 |

swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import swift
33
string describe(Type t) {
44
result = "getAliasedType:" + t.(TypeAliasType).getAliasedType()
55
or
6-
result = "getABaseType:" + t.(NominalType).getABaseType()
6+
result = "getABaseType:" + t.getABaseType()
77
}
88

99
from VarDecl v, Type t

swift/ql/test/query-tests/Security/CWE-311/CleartextStorageDatabase.expected

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ edges
22
| file://:0:0:0:0 | self [value] : | file://:0:0:0:0 | .value : |
33
| file://:0:0:0:0 | value : | file://:0:0:0:0 | [post] self [data] : |
44
| file://:0:0:0:0 | value : | file://:0:0:0:0 | [post] self [notStoredBankAccountNumber] : |
5+
| file://:0:0:0:0 | value : | file://:0:0:0:0 | [post] self [password] : |
56
| file://:0:0:0:0 | value : | file://:0:0:0:0 | [post] self [value] : |
67
| testCoreData2.swift:23:13:23:13 | value : | file://:0:0:0:0 | value : |
78
| testCoreData2.swift:37:2:37:2 | [post] obj [myValue] : | testCoreData2.swift:37:2:37:2 | [post] obj |
@@ -168,30 +169,36 @@ edges
168169
| testGRDB.swift:208:81:208:81 | password : | testGRDB.swift:208:80:208:89 | [...] |
169170
| testGRDB.swift:210:85:210:85 | password : | testGRDB.swift:210:84:210:93 | [...] |
170171
| testGRDB.swift:212:99:212:99 | password : | testGRDB.swift:212:98:212:107 | [...] |
171-
| testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | value : |
172-
| testRealm.swift:34:2:34:2 | [post] a [data] : | testRealm.swift:34:2:34:2 | [post] a |
173-
| testRealm.swift:34:11:34:11 | myPassword : | testRealm.swift:16:6:16:6 | value : |
174-
| testRealm.swift:34:11:34:11 | myPassword : | testRealm.swift:34:2:34:2 | [post] a [data] : |
175-
| testRealm.swift:42:2:42:2 | [post] c [data] : | testRealm.swift:42:2:42:2 | [post] c |
176-
| testRealm.swift:42:11:42:11 | myPassword : | testRealm.swift:16:6:16:6 | value : |
177-
| testRealm.swift:42:11:42:11 | myPassword : | testRealm.swift:42:2:42:2 | [post] c [data] : |
178-
| testRealm.swift:52:2:52:3 | [post] ...! [data] : | testRealm.swift:52:2:52:3 | [post] ...! |
179-
| testRealm.swift:52:12:52:12 | myPassword : | testRealm.swift:16:6:16:6 | value : |
180-
| testRealm.swift:52:12:52:12 | myPassword : | testRealm.swift:52:2:52:3 | [post] ...! [data] : |
181-
| testRealm.swift:59:2:59:2 | [post] g [data] : | testRealm.swift:59:2:59:2 | [post] g |
182-
| testRealm.swift:59:11:59:11 | myPassword : | testRealm.swift:16:6:16:6 | value : |
183-
| testRealm.swift:59:11:59:11 | myPassword : | testRealm.swift:59:2:59:2 | [post] g [data] : |
172+
| testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | value : |
173+
| testRealm.swift:34:6:34:6 | value : | file://:0:0:0:0 | value : |
174+
| testRealm.swift:41:2:41:2 | [post] a [data] : | testRealm.swift:41:2:41:2 | [post] a |
175+
| testRealm.swift:41:11:41:11 | myPassword : | testRealm.swift:27:6:27:6 | value : |
176+
| testRealm.swift:41:11:41:11 | myPassword : | testRealm.swift:41:2:41:2 | [post] a [data] : |
177+
| testRealm.swift:49:2:49:2 | [post] c [data] : | testRealm.swift:49:2:49:2 | [post] c |
178+
| testRealm.swift:49:11:49:11 | myPassword : | testRealm.swift:27:6:27:6 | value : |
179+
| testRealm.swift:49:11:49:11 | myPassword : | testRealm.swift:49:2:49:2 | [post] c [data] : |
180+
| testRealm.swift:59:2:59:3 | [post] ...! [data] : | testRealm.swift:59:2:59:3 | [post] ...! |
181+
| testRealm.swift:59:12:59:12 | myPassword : | testRealm.swift:27:6:27:6 | value : |
182+
| testRealm.swift:59:12:59:12 | myPassword : | testRealm.swift:59:2:59:3 | [post] ...! [data] : |
183+
| testRealm.swift:66:2:66:2 | [post] g [data] : | testRealm.swift:66:2:66:2 | [post] g |
184+
| testRealm.swift:66:11:66:11 | myPassword : | testRealm.swift:27:6:27:6 | value : |
185+
| testRealm.swift:66:11:66:11 | myPassword : | testRealm.swift:66:2:66:2 | [post] g [data] : |
186+
| testRealm.swift:73:2:73:2 | [post] h [password] : | testRealm.swift:73:2:73:2 | [post] h |
187+
| testRealm.swift:73:15:73:15 | myPassword : | testRealm.swift:34:6:34:6 | value : |
188+
| testRealm.swift:73:15:73:15 | myPassword : | testRealm.swift:73:2:73:2 | [post] h [password] : |
184189
nodes
185190
| file://:0:0:0:0 | .value2 : | semmle.label | .value2 : |
186191
| file://:0:0:0:0 | .value : | semmle.label | .value : |
187192
| file://:0:0:0:0 | .value : | semmle.label | .value : |
188193
| file://:0:0:0:0 | [post] self [data] : | semmle.label | [post] self [data] : |
189194
| file://:0:0:0:0 | [post] self [notStoredBankAccountNumber] : | semmle.label | [post] self [notStoredBankAccountNumber] : |
195+
| file://:0:0:0:0 | [post] self [password] : | semmle.label | [post] self [password] : |
190196
| file://:0:0:0:0 | [post] self [value] : | semmle.label | [post] self [value] : |
191197
| file://:0:0:0:0 | self [value] : | semmle.label | self [value] : |
192198
| file://:0:0:0:0 | value : | semmle.label | value : |
193199
| file://:0:0:0:0 | value : | semmle.label | value : |
194200
| file://:0:0:0:0 | value : | semmle.label | value : |
201+
| file://:0:0:0:0 | value : | semmle.label | value : |
195202
| testCoreData2.swift:23:13:23:13 | value : | semmle.label | value : |
196203
| testCoreData2.swift:37:2:37:2 | [post] obj | semmle.label | [post] obj |
197204
| testCoreData2.swift:37:2:37:2 | [post] obj [myValue] : | semmle.label | [post] obj [myValue] : |
@@ -421,19 +428,23 @@ nodes
421428
| testGRDB.swift:210:85:210:85 | password : | semmle.label | password : |
422429
| testGRDB.swift:212:98:212:107 | [...] | semmle.label | [...] |
423430
| testGRDB.swift:212:99:212:99 | password : | semmle.label | password : |
424-
| testRealm.swift:16:6:16:6 | value : | semmle.label | value : |
425-
| testRealm.swift:34:2:34:2 | [post] a | semmle.label | [post] a |
426-
| testRealm.swift:34:2:34:2 | [post] a [data] : | semmle.label | [post] a [data] : |
427-
| testRealm.swift:34:11:34:11 | myPassword : | semmle.label | myPassword : |
428-
| testRealm.swift:42:2:42:2 | [post] c | semmle.label | [post] c |
429-
| testRealm.swift:42:2:42:2 | [post] c [data] : | semmle.label | [post] c [data] : |
430-
| testRealm.swift:42:11:42:11 | myPassword : | semmle.label | myPassword : |
431-
| testRealm.swift:52:2:52:3 | [post] ...! | semmle.label | [post] ...! |
432-
| testRealm.swift:52:2:52:3 | [post] ...! [data] : | semmle.label | [post] ...! [data] : |
433-
| testRealm.swift:52:12:52:12 | myPassword : | semmle.label | myPassword : |
434-
| testRealm.swift:59:2:59:2 | [post] g | semmle.label | [post] g |
435-
| testRealm.swift:59:2:59:2 | [post] g [data] : | semmle.label | [post] g [data] : |
436-
| testRealm.swift:59:11:59:11 | myPassword : | semmle.label | myPassword : |
431+
| testRealm.swift:27:6:27:6 | value : | semmle.label | value : |
432+
| testRealm.swift:34:6:34:6 | value : | semmle.label | value : |
433+
| testRealm.swift:41:2:41:2 | [post] a | semmle.label | [post] a |
434+
| testRealm.swift:41:2:41:2 | [post] a [data] : | semmle.label | [post] a [data] : |
435+
| testRealm.swift:41:11:41:11 | myPassword : | semmle.label | myPassword : |
436+
| testRealm.swift:49:2:49:2 | [post] c | semmle.label | [post] c |
437+
| testRealm.swift:49:2:49:2 | [post] c [data] : | semmle.label | [post] c [data] : |
438+
| testRealm.swift:49:11:49:11 | myPassword : | semmle.label | myPassword : |
439+
| testRealm.swift:59:2:59:3 | [post] ...! | semmle.label | [post] ...! |
440+
| testRealm.swift:59:2:59:3 | [post] ...! [data] : | semmle.label | [post] ...! [data] : |
441+
| testRealm.swift:59:12:59:12 | myPassword : | semmle.label | myPassword : |
442+
| testRealm.swift:66:2:66:2 | [post] g | semmle.label | [post] g |
443+
| testRealm.swift:66:2:66:2 | [post] g [data] : | semmle.label | [post] g [data] : |
444+
| testRealm.swift:66:11:66:11 | myPassword : | semmle.label | myPassword : |
445+
| testRealm.swift:73:2:73:2 | [post] h | semmle.label | [post] h |
446+
| testRealm.swift:73:2:73:2 | [post] h [password] : | semmle.label | [post] h [password] : |
447+
| testRealm.swift:73:15:73:15 | myPassword : | semmle.label | myPassword : |
437448
subpaths
438449
| testCoreData2.swift:43:35:43:35 | bankAccountNo : | testCoreData2.swift:23:13:23:13 | value : | file://:0:0:0:0 | [post] self [notStoredBankAccountNumber] : | testCoreData2.swift:43:2:43:2 | [post] obj [notStoredBankAccountNumber] : |
439450
| testCoreData2.swift:52:41:52:41 | bankAccountNo : | testCoreData2.swift:23:13:23:13 | value : | file://:0:0:0:0 | [post] self [notStoredBankAccountNumber] : | testCoreData2.swift:52:2:52:10 | [post] ...? [notStoredBankAccountNumber] : |
@@ -449,10 +460,11 @@ subpaths
449460
| testCoreData2.swift:98:18:98:18 | d [value] : | testCoreData2.swift:70:9:70:9 | self [value] : | file://:0:0:0:0 | .value : | testCoreData2.swift:98:18:98:20 | .value : |
450461
| testCoreData2.swift:104:18:104:18 | e : | testCoreData2.swift:70:9:70:9 | self : | file://:0:0:0:0 | .value : | testCoreData2.swift:104:18:104:20 | .value : |
451462
| testCoreData2.swift:105:18:105:18 | e : | testCoreData2.swift:71:9:71:9 | self : | file://:0:0:0:0 | .value2 : | testCoreData2.swift:105:18:105:20 | .value2 : |
452-
| testRealm.swift:34:11:34:11 | myPassword : | testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:34:2:34:2 | [post] a [data] : |
453-
| testRealm.swift:42:11:42:11 | myPassword : | testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:42:2:42:2 | [post] c [data] : |
454-
| testRealm.swift:52:12:52:12 | myPassword : | testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:52:2:52:3 | [post] ...! [data] : |
455-
| testRealm.swift:59:11:59:11 | myPassword : | testRealm.swift:16:6:16:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:59:2:59:2 | [post] g [data] : |
463+
| testRealm.swift:41:11:41:11 | myPassword : | testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:41:2:41:2 | [post] a [data] : |
464+
| testRealm.swift:49:11:49:11 | myPassword : | testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:49:2:49:2 | [post] c [data] : |
465+
| testRealm.swift:59:12:59:12 | myPassword : | testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:59:2:59:3 | [post] ...! [data] : |
466+
| testRealm.swift:66:11:66:11 | myPassword : | testRealm.swift:27:6:27:6 | value : | file://:0:0:0:0 | [post] self [data] : | testRealm.swift:66:2:66:2 | [post] g [data] : |
467+
| testRealm.swift:73:15:73:15 | myPassword : | testRealm.swift:34:6:34:6 | value : | file://:0:0:0:0 | [post] self [password] : | testRealm.swift:73:2:73:2 | [post] h [password] : |
456468
#select
457469
| testCoreData2.swift:37:2:37:2 | obj | testCoreData2.swift:37:16:37:16 | bankAccountNo : | testCoreData2.swift:37:2:37:2 | [post] obj | This operation stores 'obj' in a database. It may contain unencrypted sensitive data from $@. | testCoreData2.swift:37:16:37:16 | bankAccountNo : | bankAccountNo |
458470
| testCoreData2.swift:39:2:39:2 | obj | testCoreData2.swift:39:28:39:28 | bankAccountNo : | testCoreData2.swift:39:2:39:2 | [post] obj | This operation stores 'obj' in a database. It may contain unencrypted sensitive data from $@. | testCoreData2.swift:39:28:39:28 | bankAccountNo : | bankAccountNo |
@@ -542,7 +554,8 @@ subpaths
542554
| testGRDB.swift:208:80:208:89 | [...] | testGRDB.swift:208:81:208:81 | password : | testGRDB.swift:208:80:208:89 | [...] | This operation stores '[...]' in a database. It may contain unencrypted sensitive data from $@. | testGRDB.swift:208:81:208:81 | password : | password |
543555
| testGRDB.swift:210:84:210:93 | [...] | testGRDB.swift:210:85:210:85 | password : | testGRDB.swift:210:84:210:93 | [...] | This operation stores '[...]' in a database. It may contain unencrypted sensitive data from $@. | testGRDB.swift:210:85:210:85 | password : | password |
544556
| testGRDB.swift:212:98:212:107 | [...] | testGRDB.swift:212:99:212:99 | password : | testGRDB.swift:212:98:212:107 | [...] | This operation stores '[...]' in a database. It may contain unencrypted sensitive data from $@. | testGRDB.swift:212:99:212:99 | password : | password |
545-
| testRealm.swift:34:2:34:2 | a | testRealm.swift:34:11:34:11 | myPassword : | testRealm.swift:34:2:34:2 | [post] a | This operation stores 'a' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:34:11:34:11 | myPassword : | myPassword |
546-
| testRealm.swift:42:2:42:2 | c | testRealm.swift:42:11:42:11 | myPassword : | testRealm.swift:42:2:42:2 | [post] c | This operation stores 'c' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:42:11:42:11 | myPassword : | myPassword |
547-
| testRealm.swift:52:2:52:3 | ...! | testRealm.swift:52:12:52:12 | myPassword : | testRealm.swift:52:2:52:3 | [post] ...! | This operation stores '...!' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:52:12:52:12 | myPassword : | myPassword |
548-
| testRealm.swift:59:2:59:2 | g | testRealm.swift:59:11:59:11 | myPassword : | testRealm.swift:59:2:59:2 | [post] g | This operation stores 'g' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:59:11:59:11 | myPassword : | myPassword |
557+
| testRealm.swift:41:2:41:2 | a | testRealm.swift:41:11:41:11 | myPassword : | testRealm.swift:41:2:41:2 | [post] a | This operation stores 'a' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:41:11:41:11 | myPassword : | myPassword |
558+
| testRealm.swift:49:2:49:2 | c | testRealm.swift:49:11:49:11 | myPassword : | testRealm.swift:49:2:49:2 | [post] c | This operation stores 'c' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:49:11:49:11 | myPassword : | myPassword |
559+
| testRealm.swift:59:2:59:3 | ...! | testRealm.swift:59:12:59:12 | myPassword : | testRealm.swift:59:2:59:3 | [post] ...! | This operation stores '...!' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:59:12:59:12 | myPassword : | myPassword |
560+
| testRealm.swift:66:2:66:2 | g | testRealm.swift:66:11:66:11 | myPassword : | testRealm.swift:66:2:66:2 | [post] g | This operation stores 'g' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:66:11:66:11 | myPassword : | myPassword |
561+
| testRealm.swift:73:2:73:2 | h | testRealm.swift:73:15:73:15 | myPassword : | testRealm.swift:73:2:73:2 | [post] h | This operation stores 'h' in a database. It may contain unencrypted sensitive data from $@. | testRealm.swift:73:15:73:15 | myPassword : | myPassword |

swift/ql/test/query-tests/Security/CWE-311/SensitiveExprs.expected

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,13 @@
111111
| testGRDB.swift:208:81:208:81 | password | label:password, type:credential |
112112
| testGRDB.swift:210:85:210:85 | password | label:password, type:credential |
113113
| testGRDB.swift:212:99:212:99 | password | label:password, type:credential |
114-
| testRealm.swift:34:11:34:11 | myPassword | label:myPassword, type:credential |
115-
| testRealm.swift:42:11:42:11 | myPassword | label:myPassword, type:credential |
116-
| testRealm.swift:52:12:52:12 | myPassword | label:myPassword, type:credential |
117-
| testRealm.swift:59:11:59:11 | myPassword | label:myPassword, type:credential |
114+
| testRealm.swift:31:20:31:20 | .password | label:password, type:credential |
115+
| testRealm.swift:41:11:41:11 | myPassword | label:myPassword, type:credential |
116+
| testRealm.swift:49:11:49:11 | myPassword | label:myPassword, type:credential |
117+
| testRealm.swift:59:12:59:12 | myPassword | label:myPassword, type:credential |
118+
| testRealm.swift:66:11:66:11 | myPassword | label:myPassword, type:credential |
119+
| testRealm.swift:73:2:73:4 | .password | label:password, type:credential |
120+
| testRealm.swift:73:15:73:15 | myPassword | label:myPassword, type:credential |
118121
| testSend.swift:29:19:29:19 | passwordPlain | label:passwordPlain, type:credential |
119122
| testSend.swift:33:19:33:19 | passwordPlain | label:passwordPlain, type:credential |
120123
| testSend.swift:45:13:45:13 | password | label:password, type:credential |

0 commit comments

Comments
 (0)