用户工具

站点工具


cwe:cn:definition:327

CWE-327:使用已被攻破或存在风险的密码学算法

Description Summary

The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information.

Extended Description

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.

Background Details

Cryptographic algorithms are the methods by which data is scrambled. There are a small number of well-understood and heavily studied algorithms that should be used by most applications. It is quite difficult to produce a secure algorithm, and even high profile algorithms by accomplished cryptographic experts have been broken.

Since the state of cryptography advances so rapidly, it is common for an algorithm to be considered “unsafe” even if it was once thought to be strong. This can happen when new attacks against the algorithm are discovered, or if computing power increases so much that the cryptographic algorithm no longer provides the amount of protection that was originally thought.

Likelihood of Exploit

Medium to High

Common Consequences

Scope Technical Impace Note
ConfidentialityRead application dataThe confidentiality of sensitive data may be compromised by the use of a broken or risky cryptographic algorithm.
IntegrityModify application dataThe integrity of sensitive data may be compromised by the use of a broken or risky cryptographic algorithm.
Accountability
Non-Repudiation
Hide activitiesIf 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.

Detection Methods

Detection Method - 1

Automated Analysis

Automated methods may be useful for recognizing commonly-used libraries or features that have become obsolete.>False negatives may occur if the tool is not aware of the cryptographic libraries in use, or if custom cryptography is being used.

Detection Method - 2

Manual Analysis

This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session.

Specifically, manual analysis can be useful for finding this weakness, and for minimizing false positives assuming an understanding of business logic. However, it might not achieve desired code coverage within limited time constraints. For black-box analysis, if credentials are not known for privileged accounts, then the most security-critical portions of the application may not receive sufficient attention.

Consider using OWASP CSRFTester to identify potential issues and aid in manual analysis.

These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules.
2013/05/30 09:37

Detection Method - 3

Automated Static Analysis - Binary / Bytecode

According to SOAR, the following detection techniques may be useful:

Detection Method - 4

Manual Static Analysis - Binary / Bytecode

According to SOAR, the following detection techniques may be useful:

Detection Method - 5

=== Dynamic Analysis with automated results interpretation === According to SOAR, the following detection techniques may be useful:

Detection Method - 6

Dynamic Analysis with manual results interpretation

According to SOAR, the following detection techniques may be useful:

Detection Method - 7

Manual Static Analysis - Source Code

According to SOAR, the following detection techniques may be useful:

Detection Method - 8

Automated Static Analysis - Source Code

According to SOAR, the following detection techniques may be useful:

Detection Method - 9

Automated Static Analysis

According to SOAR, the following detection techniques may be useful:

Detection Method - 10

Architecture / Design Review

According to SOAR, the following detection techniques may be useful:

Potential Mitigations

Mitigation - 1

Architecture and Design

Strategy: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. [R.327.4]

2013/05/30 09:37

Mitigation - 2

Architecture and Design

Design the software so that one cryptographic algorithm can be replaced with another. This will make it easier to upgrade to stronger algorithms.

Mitigation - 3

Architecture and Design

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.

Mitigation - 4

Architecture and Design

Strategy: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.

For example, use anti-CSRF packages such as the OWASP CSRFGuard. [R.352.3]

Another example is the ESAPI Session Management control, which includes a component for CSRF. [R.352.9]

2013/05/30 09:36

Mitigation - 5

Implementation Architecture and Design

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.

2013/05/30 09:37

Maintenance Notes

Maintenance Note - 1

Relationships between CWE-310, CWE-326, and CWE-327 and all their children need to be reviewed and reorganized.

Demonstrative Examples

Example - 1

These code examples use the Data Encryption Standard (DES).

EVP_des_ecb(); 
Cipher des=Cipher.getInstance("DES..."); 
des.initEncrypt(key2); 
function encryptPassword($password){ 
$iv_size = mcrypt_get_iv_size(MCRYPT_DES, MCRYPT_MODE_ECB); 
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); 
$key = "This is a password encryption key"; 
$encryptedPassword = mcrypt_encrypt(MCRYPT_DES, $key, $password, MCRYPT_MODE_ECB, $iv); 
return $encryptedPassword; 
 
} 

Once considered a strong algorithm, DES now regarded as insufficient for many applications. It has been replaced by Advanced Encryption Standard (AES).

Observed Examples

Reference Description
CVE-2008-3775Product uses “ROT-25” to obfuscate the password in the registry.
CVE-2007-4150product only uses “XOR” to obfuscate sensitive data
CVE-2007-5460product only uses “XOR” and a fixed key to obfuscate sensitive data
CVE-2005-4860Product substitutes characters with other characters in a fixed way, and also leaves certain input characters unchanged.
CVE-2002-2058Attackers can infer private IP addresses by dividing each octet by the MD5 hash of '20'.
CVE-2008-3188Product uses DES when MD5 has been specified in the configuration, resulting in weaker-than-expected password hashes.
CVE-2005-2946Default configuration of product uses MD5 instead of stronger algorithms that are available, simplifying forgery of certificates.
CVE-2007-6013Product uses the hash of a hash for authentication, allowing attackers to gain privileges if they can obtain the original hash.
cwe/cn/definition/327.txt · 最后更改: 2014/09/04 14:32 (外部编辑)