Usage of weak hashing library (DSS)
- Rule ID: python_lang_weak_hash_dss
- Languages: python
- Source: weak_hash_dss.yml
Description
Using a weak hashing library like DSS increases the risk of data breaches. DSS has known security flaws and vulnerabilities, and its use is no longer recommended.
Remediations
- Do not use DSS for hashing as it is considered a weak algorithm. This can compromise data security.
hashlib.new('dss', data).digest() # unsafe
- Do opt for stronger hashing algorithms like SHA-256 to enhance security.
hashlib.sha256(data).digest()
Associated CWE
OWASP Top 10
Configuration
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=python_lang_weak_hash_dss
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=python_lang_weak_hash_dss