CWE-331: Insufficient Entropy
The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.
Last updated
The product uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.
Last updated
130 recorded CVEs are caused by CWE-331 (Insufficient Entropy). The highest-severity and most recent are shown first. 37 new CWE-331 CVEs have been recorded so far in 2026 (16 in 2025).
Auth0 PHP SDK Insufficient Entropy in Cookie Encryption
WBCE CMS has Weak Random Number Generator in Password Generation Function
Rallly Insufficient Password Login Token Entropy Leads to Account Takeover
nano-id is unable to generate the correct character set
WWBN AVideo Insufficient Entropy vulnerbaility
Insufficient entropy vulnerability could lead to authentication bypass
Broadcom RAID Controller web interface is vulnerable to insufficient randomness due to improper use of ssl.rnd to setup CIM connection
Rancher: Non-random authentication token
Showing 12 of 130 recorded CWE-331 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor these CVEsWhat can happen when CWE-331 is exploited.
Bypass Protection Mechanism, Other
Affects: Access Control, Other
An attacker could guess the random numbers generated and could gain unauthorized access to a system if the random numbers are used for authentication and authorization.
Typically introduced during these phases of the software lifecycle.
Practical mitigations for CWE-331, grouped by where in the lifecycle they apply.
Determine the necessary entropy to adequately provide for randomness and predictability. This can be achieved by increasing the number of bits of objects such as keys and seeds.
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
MITRE examples of the weakness in code.
This code generates a unique random identifier for a user's session.
Vulnerable example
function generateSessionID($userID){
srand($userID);
return rand();
}The following code uses a statistical PRNG to create a URL for a receipt that remains active for some period of time after a purchase.
Vulnerable example
String GenerateReceiptURL(String baseUrl) {
Random ranGen = new Random();
ranGen.setSeed((new Date()).getTime());
return(baseUrl + ranGen.nextInt(400000000) + ".html");
}This code uses the Random.nextInt() function to generate "unique" identifiers for the receipt pages it generates. Because Random.nextInt() is a statistical PRNG, it is easy for an attacker to guess the strings it generates. Although the underlying design of the receipt system is also faulty, it would be more secure if it used a random number generator that did not produce predictable receipt identifiers, such as a cryptographic PRNG.
Real CVEs that MITRE cites as examples of this weakness.
CAPEC attack patterns that exploit this weakness.
Common questions about CWE-331.
Weakness data is sourced from the MITRE CWE catalog (v4.21). CVE associations are aggregated and kept current by RadicalNotion.AI.
Get an alert when a new CWE-331 CVE affects your products, with AI-written analysis and remediation steps.