Description: While performing a security audit using the automated tool Bandit, I identified the use of a weak hash function (MD5) in tests/common.py.
Location: File: tests/common.py, Line: 123
Python
m = hashlib.md5()
Risk: According to CWE-327, MD5 is cryptographically broken and should not be used for security-sensitive contexts. Even in test scripts, it is best practice to use more secure alternatives like SHA-256 to avoid potential risks or setting a bad example for the codebase.
Recommendation: Replace hashlib.md5() with hashlib.sha256() or explicitly set usedforsecurity=False if it's strictly for non-security purposes in newer Python versions.
Description: While performing a security audit using the automated tool Bandit, I identified the use of a weak hash function (MD5) in tests/common.py.
Location: File: tests/common.py, Line: 123
Python
m = hashlib.md5()
Risk: According to CWE-327, MD5 is cryptographically broken and should not be used for security-sensitive contexts. Even in test scripts, it is best practice to use more secure alternatives like SHA-256 to avoid potential risks or setting a bad example for the codebase.
Recommendation: Replace hashlib.md5() with hashlib.sha256() or explicitly set usedforsecurity=False if it's strictly for non-security purposes in newer Python versions.