Use of Weak Cryptographic Algorithms
The code uses broken or outdated cryptographic algorithms, modes or key sizes, such as DES, RC4, MD5, SHA-1 or ECB mode, to protect data or check its integrity.
| Severity | Medium |
| CVSS 3.1 | 5.9 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N Open in the calculator |
| CVSS 4.0 | 8.2 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-327: Use of a Broken or Risky Cryptographic Algorithm |
| OWASP Top 10 | A04:2025 Cryptographic Failures |
| Category | Cryptographic Failures |
Description
The application's code uses cryptographic algorithms, modes or key sizes that are broken or no longer considered strong enough for their purpose. Common examples are encryption with DES, Triple DES or RC4; block ciphers in ECB mode, which reveals patterns in the data; CBC mode without integrity protection, which can allow padding oracle attacks; MD5 or SHA-1 used for digital signatures or integrity checks, or message authentication built by simply hashing a secret with the data; RSA keys shorter than 2048 bits, or RSA encryption with the older PKCS#1 v1.5 padding rather than OAEP; and home-made schemes such as XOR obfuscation or custom ciphers.
An attacker who obtains data protected with a weak algorithm, for example from a database backup, a stolen file or intercepted traffic, may be able to decrypt it, recover patterns in it or modify it without detection, and may be able to forge signatures or integrity checks that the application relies on. The effort required varies: weaknesses in RC4 and ECB mode can be exploited with modest resources, while attacks on SHA-1 or Triple DES need much greater effort or large volumes of data. Some uses are acceptable, such as MD5 as a non-security checksum, so each occurrence is judged by what the algorithm protects: the sensitivity of the protected data, whether an attacker can obtain it and how long it must stay protected, as attacks only improve over time.
These choices are usually found by source code review or static analysis, searching for algorithm names and cipher settings passed to cryptographic APIs, for example Cipher.getInstance("DES") in Java, or Cipher.getInstance("AES"), which defaults to ECB mode in the standard Java provider. In testing they can show as ciphertext that repeats for repeated input, or as tokens whose structure reveals the algorithm. Password storage and TLS configuration are covered by separate findings.
Remediation
Replace weak algorithms with current, well-reviewed ones from a standard library:
- For symmetric encryption, use AES in an authenticated mode such as GCM, or ChaCha20-Poly1305, with a unique nonce for every encryption and keys of at least 128 bits, or 256 bits where long-term protection is needed.
- For integrity and signatures, use SHA-256 or stronger, HMAC for message authentication, and RSA with keys of at least 2048 bits and PSS or OAEP padding, or elliptic curve algorithms such as ECDSA with P-256, or Ed25519.
- Use a high-level, misuse-resistant library such as libsodium or Google Tink, or the platform's recommended API, rather than assembling primitives by hand, and never use custom algorithms.
- Make algorithms configurable and versioned so that they can be replaced without re-engineering, and plan the move to post-quantum algorithms for data that must stay protected for many years.
- Re-encrypt stored data, and re-issue signatures and tokens created with the weak algorithm, then retire the old keys.
Add rules for banned algorithms to static analysis in the build pipeline so that new uses are caught. Confirm the fix by reviewing the code paths that were reported and checking that data written after the change uses the new algorithm.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.