This weakness occurs when the application transmits or stores authentication credentials and uses an insecure method that is susceptible to unauthorized interception and/or retrieval.
cwe_Nature: ChildOf cwe_CWE_ID: 287 cwe_View_ID: 1000 cwe_Ordinal: Primary
cwe_Nature: ChildOf cwe_CWE_ID: 287 cwe_View_ID: 1003 cwe_Ordinal: Primary
cwe_Nature: ChildOf cwe_CWE_ID: 668 cwe_View_ID: 1000
|Access Control||Gain Privileges or Assume Identity||An attacker could gain access to user accounts and access sensitive data used by the user accounts.|
Use an appropriate security mechanism to protect the credentials.
Make appropriate use of cryptography to protect the credentials.
Use industry standards to protect the credentials (e.g. LDAP, keystore, etc.).
This code changes a user's password.
While the code confirms that the requesting user typed the same new password twice, it does not confirm that the user requesting the password change is the same user whose password will be changed. An attacker can request a change of another user's password and gain control of the victim's account.
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 who has access to config.properties can read the value of password. 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
Both of these examples verify a password by comparing it to a stored compressed version.
Because a compression algorithm is used instead of a one way hashing algorithm, an attacker can recover compressed passwords stored in the database.
The following examples show a portion of properties and configuration files for Java and ASP.NET applications. The files include username and password information but they are stored in plaintext.
This Java example shows a properties file with a plaintext username / password pair.
The following example shows a portion of a configuration file for an ASP.Net application. This configuration file includes username and password information for a connection to a database but the pair is stored in plaintext.
Username and password information should not be included in a configuration file or a properties file in plaintext as this will allow anyone who can read the file access to the resource. If possible, encrypt this information and avoid CWE-260 and CWE-13.
|CVE-2007-0681||Web app allows remote attackers to change the passwords of arbitrary users without providing the original password, and possibly perform other unauthorized actions.||https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0681|
|CVE-2000-0944||Web application password change utility doesn't check the original password.||https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2000-0944|
|CVE-2005-3435||product authentication succeeds if user-provided MD5 hash matches the hash in its database; this can be subjected to replay attacks.||https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-3435|
|CVE-2005-0408||chain: product generates predictable MD5 hashes using a constant value combined with username, allowing authentication bypass.||https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-0408|
|映射的分类名||ImNode ID||Fit||Mapped Node Name|
|OWASP Top Ten 2007||A7||CWE More Specific||Broken Authentication and Session Management|
|OWASP Top Ten 2004||A3||CWE More Specific||Broken Authentication and Session Management|