Use of a broken or risky cryptographic algorithm
Description
The MD5 message-digest algorithm has been cryptographically broken and is unsuitable for further use. The MD5 hash algorithm has been found to be vulnerable to producing collisions. This means that two different values, when hashed, can lead to the same hash value. It is recommended that the SHA-3 or BLAKE2 family of algorithms be used for non-password based cryptographic hashes instead. For password based cryptographic hashes, consider using the bcrypt or Argon2id family of cryptographic hashes.
Examples
Insecure Code
go
import "crypto/md5"Secure Code
go
import "golang.org/x/crypto/blake2b"Remediation
Replace MD5 with a secure hash algorithm like BLAKE2 or Argon2id.
Rule Details
| Field | Value |
|---|---|
| ID | CODE-0772 |
| Category | Crypto |
| Severity | MEDIUM |
| CWE | CWE-327 |
| Confidence | HIGH |
| Impact | MEDIUM |
| Likelihood | MEDIUM |
| Exploitability | EASY |
| Tags | cryptographic algorithm, hash function |
| OWASP | A3:2017-Sensitive Data Exposure, A02:2021-Cryptographic Failures |