Obscuring a password with a trivial encoding does not protect the password.
View on MITREPassword management issues occur when a password is stored in plaintext in an application's properties or configuration file. A programmer can 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.
Passwords should be encrypted with keys that are at least 128 bits in length for adequate security.
No detection method information available for this CWE.
The following code reads a password from a properties file and uses the password to connect to a database.
This code will run successfully, but anyone with access to config.properties can read the value of password and easily determine that the value has been base 64 encoded. If a devious employee has access to this information, they can use it to break into the system.
The following code reads a password from the registry and uses the password to create a new network credential.
This code will run successfully, but anyone who has access to the registry key used to store the password can read the value of password. If a devious employee has access to this information, they can use it to break into the system.
No relationship information available for this CWE.
CWE-261: Weak Encoding for Password is a Common Weakness Enumeration (CWE) entry maintained by MITRE. Obscuring a password with a trivial encoding does not protect the password. Password management issues occur when a password is stored in plaintext in an application's properties or configuration file. A programmer can 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.
If exploited, CWE-261 (Weak Encoding for Password) it can compromise Access Control, leading to outcomes such as Gain Privileges or Assume Identity.
Recommended mitigations for CWE-261 include: Passwords should be encrypted with keys that are at least 128 bits in length for adequate security.
CWE-261 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.
A CWE (Common Weakness Enumeration) like CWE-261 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.