CWE-256: Plaintext Storage of a Password
Description
The product stores a password in plaintext within resources such as memory or files.
- Abstraction
- BaseA weakness specific enough to point to detection and prevention methods.
- Likelihood of exploit
- High
- Status
- Incomplete
Common consequences
- Access Control
Gain Privileges or Assume Identity
Storing a plaintext password in a configuration file allows anyone who can read the file to access the password-protected resource. In some contexts, even storage of a plaintext password in memory is considered a security risk if the password is not cleared immediately after it is used.
Potential mitigations
- Architecture and Design
Avoid storing passwords in easily accessible locations.
- Architecture and Design
Consider storing cryptographic hashes of passwords as an alternative to storing in plaintext.
- Effectiveness: None
A programmer might attempt to remedy the password management problem by obscuring the password with an encoding function, such as base 64 encoding, but this effort does not adequately protect the password because the encoding can be detected and decoded easily.
Related weaknesses
Parent weaknesses
CAPEC attack patterns that exploit it
CWE 4.20 links no CAPEC attack pattern to this weakness.