High severityC#CryptographyHIGH confidence
Weak Hash
A broken hash function (MD5 or SHA-1) is used.
Standards mapping
- OWASP Top 10
- A02:2021 - Cryptographic Failures
- OWASP ASVS
- V6.2.1 (L2)
Vulnerable vs. safe
Flagged by this check
using var md5 = MD5.Create();Passes - the safe pattern
using var sha = SHA256.Create();Why it matters & how to fix it
A broken hash function (MD5 or SHA-1) is used. These are collision-prone and unfit for signatures, integrity, or password storage (CWE-327/CWE-328). Use SHA-256 or SHA-3 for integrity/signatures, and a dedicated password KDF (PBKDF2 via Rfc2898DeriveBytes with SHA-256, bcrypt, or Argon2) for passwords.
References
Rule ID integsec.csharp.crypto.weak-hash - 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
- Python - CryptographyWeak Hash MD5 SHA1