Skip to content

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

FieldValue
IDCODE-0772
CategoryCrypto
SeverityMEDIUM
CWECWE-327
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityEASY
Tagscryptographic algorithm, hash function
OWASPA3:2017-Sensitive Data Exposure, A02:2021-Cryptographic Failures