Weak Hash algorithm used.
ID |
objectivec.cryptography.ios_weak_hash |
Severity |
low |
Remediation Complexity |
medium |
Remediation Risk |
medium |
Remediation Effort |
medium |
Resource |
Cryptography |
Language |
Objective-C |
Rationale
Weak Hash algorithm used. The hash algorithm is known to have hash collisions.
The following code illustrates a vulnerable pattern detected by this rule:
// ============================================
// POSITIVE CASES (should trigger findings)
// ============================================
void badMD5Hash() {
const char *str = "password";
unsigned char result[CC_MD5_DIGEST_LENGTH];
// VULNERABLE: Weak Hash algorithm used.
CC_MD5(str, (CC_LONG)strlen(str), result);
}
Remediation
Follow secure coding practices and review the references below for detailed remediation guidance.
References
-
OWASP Top 10 2025 - A04 : Cryptographic Failures.