结构: Simple
Abstraction: Class
状态: Draft
被利用可能性: High
The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information.
The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has been protected. Well-known techniques may exist to break the algorithm.
cwe_Nature: ChildOf cwe_CWE_ID: 693 cwe_View_ID: 1000 cwe_Ordinal: Primary
cwe_Nature: PeerOf cwe_CWE_ID: 311 cwe_View_ID: 1000
Language: {'cwe_Class': 'Language-Independent', 'cwe_Prevalence': 'Undetermined'}
范围 | 影响 | 注释 |
---|---|---|
Confidentiality | Read Application Data | The confidentiality of sensitive data may be compromised by the use of a broken or risky cryptographic algorithm. |
Integrity | Modify Application Data | The integrity of sensitive data may be compromised by the use of a broken or risky cryptographic algorithm. |
['Accountability', 'Non-Repudiation'] | Hide Activities | If the cryptographic algorithm is used to ensure the identity of the source of the data (such as digital signatures), then a broken algorithm will compromise this scheme and the source of the data cannot be proven. |
False negatives may occur if the tool is not aware of the cryptographic libraries in use, or if custom cryptography is being used.
These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules.
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
According to SOAR, the following detection techniques may be useful:
策略: Libraries or Frameworks
When there is a need to store or transmit sensitive data, use strong, up-to-date cryptographic algorithms to encrypt that data. Select a well-vetted algorithm that is currently considered to be strong by experts in the field, and use well-tested implementations. As with all cryptographic mechanisms, the source code should be available for analysis. For example, US government systems require FIPS 140-2 certification. Do not develop custom or private cryptographic algorithms. They will likely be exposed to attacks that are well-understood by cryptographers. Reverse engineering techniques are mature. If the algorithm can be compromised if attackers find out how it works, then it is especially weak. Periodically ensure that the cryptography has not become obsolete. Some older algorithms, once thought to require a billion years of computing time, can now be broken in days or hours. This includes MD4, MD5, SHA1, DES, and other algorithms that were once regarded as strong. [REF-267]
策略:
Design the software so that one cryptographic algorithm can be replaced with another. This will make it easier to upgrade to stronger algorithms.
策略:
Carefully manage and protect cryptographic keys (see CWE-320). If the keys can be guessed or stolen, then the strength of the cryptography itself is irrelevant.
策略: Libraries or Frameworks
Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Industry-standard implementations will save development time and may be more likely to avoid errors that can occur during implementation of cryptographic algorithms. Consider the ESAPI Encryption feature.
策略:
When using industry-approved techniques, use them correctly. Don't cut corners by skipping resource-intensive steps (CWE-325). These steps are often essential for preventing common attacks.
These code examples use the Data Encryption Standard (DES).
bad C
bad Java
bad PHP
Once considered a strong algorithm, DES now regarded as insufficient for many applications. It has been replaced by Advanced Encryption Standard (AES).
标识 | 说明 | 链接 |
---|---|---|
CVE-2008-3775 | Product uses "ROT-25" to obfuscate the password in the registry. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3775 |
CVE-2007-4150 | product only uses "XOR" to obfuscate sensitive data | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-4150 |
CVE-2007-5460 | product only uses "XOR" and a fixed key to obfuscate sensitive data | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-5460 |
CVE-2005-4860 | Product substitutes characters with other characters in a fixed way, and also leaves certain input characters unchanged. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-4860 |
CVE-2002-2058 | Attackers can infer private IP addresses by dividing each octet by the MD5 hash of '20'. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2002-2058 |
CVE-2008-3188 | Product uses DES when MD5 has been specified in the configuration, resulting in weaker-than-expected password hashes. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3188 |
CVE-2005-2946 | Default configuration of product uses MD5 instead of stronger algorithms that are available, simplifying forgery of certificates. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-2946 |
CVE-2007-6013 | Product uses the hash of a hash for authentication, allowing attackers to gain privileges if they can obtain the original hash. | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-6013 |
映射的分类名 | ImNode ID | Fit | Mapped Node Name |
---|---|---|---|
CLASP | Using a broken or risky cryptographic algorithm | ||
OWASP Top Ten 2004 | A8 | CWE More Specific | Insecure Storage |
CERT C Secure Coding | MSC30-C | CWE More Abstract | Do not use the rand() function for generating pseudorandom numbers |
CERT C Secure Coding | MSC32-C | CWE More Abstract | Properly seed pseudorandom number generators |
The CERT Oracle Secure Coding Standard for Java (2011) | MSC02-J | Generate strong random numbers | |
OMG ASCSM | ASCSM-CWE-327 |