CWE-309: Use of Password System for Primary Authentication
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 it's found
Use of Password System for Primary Authentication is typically found by tracing untrusted input from where it enters the system to the point where it is used without the check or neutralization this weakness describes, combining manual code review with dynamic testing.
Consequences
- Bypass Protection Mechanism, Gain Privileges or Assume Identity: A password authentication mechanism error will almost always result in attackers being authorized as valid users.
Mitigations
- Architecture and Design: In order to protect password systems from compromise, the following should be noted:Passwords should be stored safely to prevent insider attack and to ensure that -- if a system is compromised -- the passwords are not retrievable. Due to password reuse, this information may be useful in the compromise of other systems these users work with. In order to protect these passwords, they should be stored encrypted, in a non-reversible state, such that the original text password cannot be extracted from the stored value. Password aging should be strictly enforced to ensure that passwords do not remain unchanged for long periods of time. The longer a password remains in use, the higher the probability that it has been compromised. For this reason, passwords should require refreshing periodically, and users should be informed of the risk of passwords which remain in use for too long. Password strength should be enforced intelligently. Rather than restrict passwords to specific content, or specific length, users should be encouraged to use upper and lower case letters, numbers, and symbols in their passwords. The system should also ensure that no passwords are derived from dictionary words.
- Architecture and Design: Use a zero-knowledge password protocol, such as SRP.
- Architecture and Design: Ensure that passwords are stored safely and are not reversible.
- Architecture and Design: Implement password aging functionality that requires passwords be changed after a certain point.
- Architecture and Design: Use a mechanism for determining the strength of a password and notify the user of weak password use.
- Architecture and Design: 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.
Where this fits in a TurboPentest engagement
This weakness is not covered by the automated black-box pentest. IntegSec pentesters cover it in a manual engagement.
Frequently asked questions
What is CWE-309?
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 do you find Use of Password System for Primary Authentication?
Use of Password System for Primary Authentication is typically found by tracing untrusted input from where it enters the system to the point where it is used without the check or neutralization this weakness describes, combining manual code review with dynamic testing.
What is the impact of CWE-309?
Bypass Protection Mechanism, Gain Privileges or Assume Identity: A password authentication mechanism error will almost always result in attackers being authorized as valid users.
Does TurboPentest test for Use of Password System for Primary Authentication?
This weakness is not covered by the automated black-box pentest. IntegSec pentesters cover it in a manual engagement.
Related CWEs
- Class weaknessCWE-1390: Weak Authentication
- Base weaknessCWE-654: Reliance on a Single Factor in a Security Decision
- Base weaknessCWE-308: Use of Single-factor Authentication
- Variant weaknessCWE-259: Use of Hard-coded Password
- Class weaknessCWE-287: Improper Authentication
- Class weaknessCWE-345: Insufficient Verification of Data Authenticity
Written and reviewed by
Michel Chamberland - Founder & CEO, IntegSec
CISSP, OSCP, OSCE, CEH, GIAC, CCSK · 20+ years in offensive security
Michel has spent 20+ years on offensive security teams including IBM X-Force Red and Trustwave SpiderLabs, leading penetration tests, red team engagements, and breach response for Fortune 500 customers. He is the founder of IntegSec and the architect of TurboPentest.
Find these issues before an attacker does
TurboPentest runs an agentic AI pentest against your target and reports findings with proof, from $99 per target.
Start a pentest