|
1 |
| -## Source implementation of a weak/broken cryptography hash function |
| 1 | +# Source Implementation of a Weak/Broken Cryptographic Hash Function |
2 | 2 |
|
3 |
| -### Summary |
4 |
| -An implementation of a weak/broken hash function was found in source code. |
| 3 | +## Summary |
5 | 4 |
|
6 |
| -### Details |
7 |
| -TO DO - put more details of problem and solution here |
| 5 | +* An implementation of a weak/broken hash function such as MD-5 or SHA-1 was found in source code. |
| 6 | +* Remove the implementation of the weak/broken hash function. |
| 7 | +* Replace the use of insecure hashing algorithms with more secure alternatives such as an algorithm from the SHA-2 family (SHA256, SHA384, and SHA512). |
8 | 8 |
|
9 |
| -### Severity Considerations |
10 |
| -TO DO - put more details on the severity of the issue here. Generally how big of a problem is this, and what makes it more or less of a problem? |
| 9 | +## Details |
11 | 10 |
|
| 11 | +### Custom Cryptographic Implementation |
| 12 | + |
| 13 | +Correct and secure implementation of cryptographic algorithms is very complex and difficult. |
| 14 | +Developers should always use well-vetted libraries for cryptographic operations rather than producing their own implementations of those functions. |
| 15 | + |
| 16 | +### Weak Hash Algorithms |
| 17 | + |
| 18 | +Hash collisions are computationally feasible for older, weak hash algorithms such as MD2, MD4, MD5, and SHA-1. |
| 19 | +A hash collision allows an attacker to substitute an alternative input that results in the same hash value. |
| 20 | +Collision attacks allow attackers to undermine the security of systems using an insecure hash algorithm (e.g., by forging digital signatures, concealing data tampering, or cracking passwords). |
| 21 | + |
| 22 | +## Severity Considerations |
| 23 | + |
| 24 | +Developers should almost never implement their own versions of cryptographic operations. Furthermore, weak hash algorithms should not be used, especially for security purposes. |
| 25 | + |
| 26 | +## Solution |
| 27 | + |
| 28 | +### .NET |
| 29 | + |
| 30 | +Replace usages of insecure hash algorithms with `System.Security.Cryptography.SHA512Cng`, `System.Security.Cryptography.SHA384Cng`, or `System.Security.Cryptography.SHA256Cng`. |
0 commit comments