Aller au contenu

Weak KDF Iterations (ARCH5116)

Ce contenu n’est pas encore disponible dans votre langue.

Key go.security.weak-kdf-iterations · Severity warning · Category security · CWE CWE-916

Using a password KDF with too few iterations, or storing passwords with a fast hash, weakens resistance to brute-force attacks.

func hashPassword(pw, salt []byte) []byte {
return pbkdf2.Key(pw, salt, 1000, 32, sha256.New) // too low
}
func hashPassword(pw, salt []byte) []byte {
return pbkdf2.Key(pw, salt, 600_000, 32, sha256.New)
}

Use a high iteration count for PBKDF2 (OWASP: 600,000+ with SHA-256) or prefer a KDF like bcrypt/scrypt/argon2.