Description
The use of password systems as the primary means of authentication may be subject to several flaws or shortcomings, each reducing the effectiveness of the mechanism.
Potential Impact
Access Control
Bypass Protection Mechanism, Gain Privileges or Assume Identity
Demonstrative Examples
unsigned char *check_passwd(char *plaintext) {ctext = simple_digest("sha1",plaintext,strlen(plaintext), ... );
//Login if hash matches stored hash
if (equal(ctext, secret_password())) {login_user();}}String plainText = new String(plainTextIn);MessageDigest encer = MessageDigest.getInstance("SHA");encer.update(plainTextIn);byte[] digest = password.digest();
//Login if hash matches stored hash
if (equal(digest,secret_password())) {login_user();}Mitigations & Prevention
In order to protect password systems from compromise, the following should be noted:
Use a zero-knowledge password protocol, such as SRP.
Ensure that passwords are stored safely and are not reversible.
Implement password aging functionality that requires passwords be changed after a certain point.
Use a mechanism for determining the strength of a password and notify the user of weak password use.
Inform the user of why password protections are in place, how they work to protect data integrity, and why it is important to heed their warnings.
Related Weaknesses
Taxonomy Mappings
- CLASP: — Using password systems
- OWASP Top Ten 2004: A3 — Broken Authentication and Session Management
Frequently Asked Questions
What is CWE-309?
CWE-309 (Use of Password System for Primary Authentication) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The use of password systems as the primary means of authentication may be subject to several flaws or shortcomings, each reducing the effectiveness of the mechanism.
How can CWE-309 be exploited?
Attackers can exploit CWE-309 (Use of Password System for Primary Authentication) to bypass protection mechanism, gain privileges or assume identity. This weakness is typically introduced during the Architecture and Design phase of software development.
How do I prevent CWE-309?
Key mitigations include: In order to protect password systems from compromise, the following should be noted:
What is the severity of CWE-309?
CWE-309 is classified as a Base-level weakness (Medium abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.