This weakness occurs when an application relies solely on password-based authentication as its main security gate. This single-factor approach is inherently vulnerable to a range of attacks that can compromise user accounts.
Relying only on passwords for authentication creates a single point of failure in your security model. Passwords are frequently weak, reused across sites, or stolen through phishing, data breaches, or brute-force attacks. Without additional safeguards, an attacker who obtains a password gains full access to the associated account and its privileges. To mitigate this, you should implement defense-in-depth by adding secondary authentication factors (multi-factor authentication). Additionally, enforce strong password policies, use secure hashing algorithms (like Argon2 or bcrypt) for storage, and implement account lockouts or rate-limiting to thwart automated attacks. Treating passwords as the sole authentication method is a high-risk design choice in modern applications.
Impact: Bypass Protection MechanismGain Privileges or Assume Identity
A password authentication mechanism error will almost always result in attackers being authorized as valid users.
c
//Login if hash matches stored hash* if (equal(ctext, secret_password())) { ``` login_user(); } }
java
//Login if hash matches stored hash* if (equal(digest,secret_password())) { ``` login_user(); }
High