Medium severityPythonCryptographyMEDIUM confidence
Weak Hash MD5 SHA1
MD5/SHA-1 are cryptographically broken and unsuitable for security use such as password storage or integrity checks (CWE-327/CWE-328).
Standards mapping
- OWASP Top 10
- A02:2021 - Cryptographic Failures
- OWASP ASVS
- V6.2.1 (L2)
Vulnerable vs. safe
Flagged by this check
return hashlib.md5(data).hexdigest()Passes - the safe pattern
return hashlib.sha256(data).hexdigest()Why it matters & how to fix it
MD5/SHA-1 are cryptographically broken and unsuitable for security use such as password storage or integrity checks (CWE-327/CWE-328). For passwords use a slow KDF (bcrypt, scrypt, or argon2); for integrity use SHA-256 or stronger. If MD5 is genuinely non-security (e.g. a cache key), pass usedforsecurity=False.
References
Rule ID integsec-python-weak-hash-md5-sha1 - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - CryptographyInsecure Randomness For Secrets
- JavaScript / TypeScript - CryptographyWeak Cipher Algorithm
- JavaScript / TypeScript - CryptographyWeak Hash Algorithm
- Python - CryptographyInsecure Random Token
- Python - CryptographyWeak Cipher DES ECB
- Java - CryptographyHardcoded Crypto Key IV