A07:2021 - Identification and Authentication Failures
Authentication failures occur when an application incorrectly implements session management or identity functions, allowing attackers to compromise user accounts.
Key Authentication Vulnerabilities
- Weak Password Management: Allowing short, common passwords, or using outdated hashing (MD5).
- Exposed Session IDs: Storing session tokens (cookies) without the
SecureorHttpOnlyflags, making them vulnerable to XSS or network sniffing. - Brute Force Vulnerability: Failing to implement account lockout policies after repeated failed login attempts, making dictionary attacks trivial.
- Improper Credential Recovery: Flaws in 'Forgot Password' functionality (e.g., sending the password in cleartext via email).
Defense: Implement MFA, use robust key-stretching algorithms (Bcrypt), and ensure session tokens are short-lived and securely transmitted.