Skip to content
15 changes: 15 additions & 0 deletions rules/scala/security/rsa-padding-set-scala.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
id: rsa-padding-set-scala
language: scala
severity: warning
message: >-
Usage of RSA without OAEP (Optimal Asymmetric Encryption Padding) may.
note: >-
[CWE-780] Use of RSA Algorithm without OAEP
[REFERENCES]
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
rule:
any:
- pattern: $CIPHER.getInstance($MODE)
constraints:
MODE:
regex: ".*RSA/.*/NoPadding.*"
18 changes: 18 additions & 0 deletions rules/swift/security/insecure-biometrics-swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
id: insecure-biometrics-swift
language: swift
severity: info
message: >-
The application was observed to leverage biometrics via Local
Authentication, which returns a simple boolean result for authentication.
This design is subject to bypass with runtime tampering tools such as
Frida, Substrate, and others. Although this is limited to rooted
(jailbroken) devices, consider implementing biometric authentication the
reliable way - via Keychain Services.
note: >-
[CWE-305] Authentication Bypass by Primary Weakness
[REFERENCES]
- https://mobile-security.gitbook.io/mobile-security-testing-guide/ios-testing-guide/0x06f-testing-local-authentication
- https://shirazkhan030.medium.com/biometric-authentication-in-ios-6c53c54f17df
rule:
pattern: |
$X.evaluatePolicy
16 changes: 16 additions & 0 deletions tests/__snapshots__/insecure-biometrics-swift-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
id: insecure-biometrics-swift
snapshots:
? |
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: "Authenticate to the application
: labels:
- source: context.evaluatePolicy
style: primary
start: 0
end: 22
? |
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: "Authenticate to the application"
: labels:
- source: context.evaluatePolicy
style: primary
start: 0
end: 22
2 changes: 2 additions & 0 deletions tests/__snapshots__/rsa-padding-set-scala-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id: rsa-padding-set-scala
snapshots: {}
9 changes: 9 additions & 0 deletions tests/scala/rsa-padding-set-scala-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
id: rsa-padding-set-scala
valid:
- |
Cipher.getInstance("AES/CBC/PKCS5Padding");
Cipher.getInstance("DES/ECB/PKCS5Padding");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
invalid:
- |
Cipher.getInstance("RSA/ECB/NoPadding")
7 changes: 7 additions & 0 deletions tests/swift/insecure-biometrics-swift-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id: insecure-biometrics-swift
valid:
- |
context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error)
invalid:
- |
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: "Authenticate to the application"