CWE-1240: Use of a Cryptographic Primitive with a Risky Implementation

low-risk

To fulfill the need for a cryptographic primitive, the product implements a cryptographic algorithm using a non-standard, unproven, or disallowed/non-compliant cryptographic implementation.

Abstraction: Base

Common Consequences

Confidentiality Read Application Data

Detection Methods

Architecture or Design Review

Review requirements, documentation, and product design to ensure that primitives are consistent with the strongest-available recommendations from trusted parties. If the product appears to be using custom or proprietary implementations that have not had sufficient public review and approval, then this is a significant concern.

Manual Analysis

Analyze the product to ensure that implementations for each primitive do not contain any known vulnerabilities and are not using any known-weak algorithms, including MD4, MD5, SHA1, DES, etc.

Dynamic Analysis with Manual Results Interpretation

For hardware, during the implementation (pre-Silicon / post-Silicon) phase, dynamic tests should be done to ensure that outputs from cryptographic routines are indeed working properly, such as test vectors provided by NIST [REF-1236].

Dynamic Analysis with Manual Results Interpretation

It needs to be determined if the output of a cryptographic primitive is lacking entropy, which is one clear sign that something went wrong with the crypto implementation. There exist many methods of measuring the entropy of a bytestream, from sophisticated ones (like calculating Shannon's entropy of a sequence of characters) to crude ones (by compressing it and comparing the size of the original bytestream vs. the compressed - a truly random byte stream should not be compressible and hence the uncompressed and compressed bytestreams should be nearly identical in size).

Real-World Examples (10)

CVE CVSS EPSS KEV
CVE-2025-29808 5.5 0.4%
CVE-2024-0220 8.3 0.2%
CVE-2025-22475 3.7 0.2%
CVE-2024-0323 9.8 0.1%
CVE-2025-24802 8.6 0.1%
CVE-2025-53960 5.9 0.1%
CVE-2023-51392 6.2 0.0%
CVE-2025-58720 7.8 0.0%
CVE-2026-22705 6.4 0.0%
CVE-2025-62514 8.3 0.0%
0
/ 100
low-risk
Active Threat 0/50 · Minimal
Exploit Availability 0/50 · Minimal