MASWE-0019: Potentially Weak Cryptography Implementations
Content in BETA
This content is in beta and still under active development, so it is subject to change any time (e.g. structure, IDs, content, URLs, etc.).
Draft Weakness
This weakness hasn't been created yet and it's in draft. But you can check its status or start working on it yourself. If the issue has not yet been assigned, you can request to be assigned to it and submit a PR with the new content for that weakness by following our guidelines.
Check our GitHub Issues for MASWE-0019
Initial Description or Hints¶
Don't use outdated or known weak implementations and don't build your own cryptography. Using custom cryptography instead of relying on established, expert-designed APIs or certified modules exposes apps to vulnerabilities due to potential implementation flaws and lack of rigorous security review.
Relevant Topics¶
- platform-provided cryptographic APIs (e.g. conscrypt/CryptoKit)
- custom-made cryptographic APIs (e.g. via xor, bit flipping, etc. or cryptographic constants or values such as sbox, etc.)
- custom algorithms, primitives, protocols
- specify Cipher.getInstance provider (Android)
- Android Security Provider (Android)
- Jetpack Security Crypto Library (Android)
- BoucyCastle algorithms (Android)
References¶
- https://cwe.mitre.org/data/definitions/1240.html
- https://cwe.mitre.org/data/definitions/327.html
- https://developer.android.com/reference/javax/crypto/Cipher#getInstance(java.lang.String)
- https://developer.android.com/privacy-and-security/security-gms-provider
- https://developer.android.com/privacy-and-security/cryptography#bc-algorithms
- https://developer.android.com/privacy-and-security/cryptography#jetpack_security_crypto_library
- https://developer.android.com/privacy-and-security/cryptography#crypto_provider
- https://developer.android.com/privacy-and-security/cryptography#deprecated-functionality
- https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/TechGuidelines/TG02102/BSI-TR-02102-1.pdf?__blob=publicationFile