---
title: "CWE-309: Use of Password System for Primary Authentication"
url: https://radicalnotion.ai/cwe/cwe-309
type: cwe
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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-309: Use of Password System for Primary Authentication

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Draft
- **Likelihood of exploit:** High
- **CVEs with this as primary weakness:** 1
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## 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.

## Background

Password systems are the simplest and most ubiquitous authentication mechanisms. However, they are subject to such well known attacks,and such frequent compromise that their use in the most simple implementation is not practical.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |

## Applicable platforms

**Languages:** Go (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control | Bypass Protection Mechanism, Gain Privileges or Assume Identity | A password authentication mechanism error will almost always result in attackers being authorized as valid users. |

## Potential 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.

## Demonstrative examples

### Example 1

In both of these examples, a user is logged in if their given password matches a stored password:

Bad code:

```c
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();
    }
}
```

Bad code:

```java
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();
}
```

This code relies exclusively on a password mechanism (CWE-309) using only one factor of authentication (CWE-308). If an attacker can steal or guess a user's password, they are given full access to their account. Note this code also uses SHA-1, which is a weak hash (CWE-328). It also does not use a salt (CWE-759).

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2024-45675 | IBM Informix Dynamic Server Authentication Bypass | high | 8.4 | - | No | 2025-12-02 |

## Related attack patterns (CAPEC)

- [CAPEC-16](https://radicalnotion.ai/capec/capec-16): Dictionary-based Password Attack
- [CAPEC-49](https://radicalnotion.ai/capec/capec-49): Password Brute Forcing
- [CAPEC-509](https://radicalnotion.ai/capec/capec-509): Kerberoasting
- [CAPEC-55](https://radicalnotion.ai/capec/capec-55): Rainbow Table Password Cracking
- [CAPEC-555](https://radicalnotion.ai/capec/capec-555): Remote Services with Stolen Credentials
- [CAPEC-560](https://radicalnotion.ai/capec/capec-560): Use of Known Domain Credentials
- [CAPEC-561](https://radicalnotion.ai/capec/capec-561): Windows Admin Shares with Stolen Credentials
- [CAPEC-565](https://radicalnotion.ai/capec/capec-565): Password Spraying
- [CAPEC-600](https://radicalnotion.ai/capec/capec-600): Credential Stuffing
- [CAPEC-652](https://radicalnotion.ai/capec/capec-652): Use of Known Kerberos Credentials
- [CAPEC-653](https://radicalnotion.ai/capec/capec-653): Use of Known Operating System Credentials
- [CAPEC-70](https://radicalnotion.ai/capec/capec-70): Try Common or Default Usernames and Passwords

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-654](https://radicalnotion.ai/cwe/cwe-654) | Reliance on a Single Factor in a Security Decision |
| Parent | [CWE-1390](https://radicalnotion.ai/cwe/cwe-1390) | Weak Authentication |
| Peer | [CWE-262](https://radicalnotion.ai/cwe/cwe-262) | Not Using Password Aging |
| Peer | [CWE-308](https://radicalnotion.ai/cwe/cwe-308) | Use of Single-factor Authentication |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CLASP | Using password systems | - | - |
| OWASP Top Ten 2004 | Broken Authentication and Session Management | A3 | CWE More Specific |
| OWASP Golang Secure Coding Practices Guide | Authentication and Password Management | - | - |

## 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.

### What CVEs are caused by CWE-309?

1 recorded CVE is attributed to CWE-309: CVE-2024-45675.

### Is CWE-309 part of the OWASP Top 10?

CWE-309 maps to OWASP Top Ten 2004: Broken Authentication and Session Management (A3) in the OWASP security taxonomy.

### How do you prevent CWE-309?

In order to protect password systems from compromise, the following should be noted:

### What are the consequences of CWE-309?

Exploiting CWE-309 can lead to: Bypass Protection Mechanism, Gain Privileges or Assume Identity.

### Is CWE-309 actively exploited?

1 recorded CVE is caused by CWE-309; it is not currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/309.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-309). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
