Skip to content

Commit

Permalink
Refactor weak encryption mode detection to use regex for broader matc…
Browse files Browse the repository at this point in the history
…hing and simplify summary
  • Loading branch information
cpholguera committed Feb 1, 2025
1 parent 8869c4a commit e58bac4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rules/mastg-android-weak-encryption-modes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ rules:
- java
severity: WARNING
metadata:
summary: This rule looks for weak encryption modes such as AES-ECB.
summary: This rule looks for weak encryption modes.
message: "[MASVS-CRYPTO-1] Weak encryption modes found in use."
pattern-either:
- pattern: Cipher.getInstance("AES/ECB/NoPadding")
- pattern: Cipher.getInstance("AES")
- pattern: Cipher.getInstance("AES/ECB/PKCS5Padding")
- pattern: Cipher.getInstance("AES/ECB/ISO10126Padding")
- pattern: Cipher.getInstance("DES/ECB/PKCS5Padding")
- pattern: Cipher.getInstance("DESede/ECB/PKCS5Padding")
- pattern-regex: Cipher\.getInstance\("?[A-Za-z0-9]+/ECB(/[A-Za-z0-9]+)?"?\)


0 comments on commit e58bac4

Please # to comment.