CWE-309: Use of Password System for Primary Authentication

Export to Word

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.

Extended Description

N/A


ThreatScore

Threat Mapped score: 3.0

Industry: Finiancial

Threat priority: P2 - Serious (High)


Observed Examples (CVEs)

Related Attack Patterns (CAPEC)


Attack TTPs

Malware

APTs (Intrusion Sets)

Modes of Introduction

Phase Note
Architecture and Design N/A

Common Consequences

Potential Mitigations

Applicable Platforms


Demonstrative Examples

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

Body: 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).

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

Notes

← Back to CWE list