Skip to content

Commit 28a707a

Browse files
committed
Swift: Model RNCryptor.
1 parent a8ef9cc commit 28a707a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

swift/ql/src/queries/Security/CWE-321/HardcodedEncryptionKey.ql

+8
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ class EncryptionKeySink extends Expr {
4646
fName.matches("init(key:%") and
4747
call.getArgument(0).getExpr() = this
4848
)
49+
or
50+
// RNCryptor
51+
exists(ClassOrStructDecl c, MethodDecl f, CallExpr call |
52+
c.getFullName() = ["RNCryptor", "RNEncryptor", "RNDecryptor"] and
53+
c.getAMember() = f and
54+
call.getStaticTarget() = f and
55+
call.getArgumentWithLabel("encryptionKey").getExpr() = this
56+
)
4957
}
5058
}
5159

0 commit comments

Comments
 (0)