Skip to content

Commit 994ea70

Browse files
committed
Swift: Clean up the QL a little.
1 parent 6a0b56b commit 994ea70

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

swift/ql/src/queries/Security/CWE-311/CleartextStorageDatabase.ql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ class CleartextStorageConfig extends TaintTracking::Configuration {
9393
// for example in `realmObj.data = sensitive`.
9494
isSink(node) and
9595
exists(ClassOrStructDecl cd, IterableDeclContext cx |
96-
(cx = cd or cx.(ExtensionDecl).getExtendedTypeDecl() = cd) and
97-
c.getAReadContent().(DataFlow::Content::FieldContent).getField() = cx.getAMember() and
98-
// TODO: add a `getAMember` version that accounts for extensions?
99-
cd.getABaseTypeDecl*().getName() = ["NSManagedObject", "RealmSwiftObject"]
96+
cd.getABaseTypeDecl*().getName() = ["NSManagedObject", "RealmSwiftObject"] and
97+
cx.getNominalTypeDecl() = cd and
98+
c.getAReadContent().(DataFlow::Content::FieldContent).getField() = cx.getAMember()
10099
)
101100
or
102101
// any default implicit reads

0 commit comments

Comments
 (0)