Skip to main content

CWE-330: Use of Insufficiently Random Values

ClassStableExploit Likelihood: High

The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.

View on MITRE
Back to CWE Lookup

Technical Details

Structure
Simple

Applicable To

Languages
Not Language-Specific
Platforms

Frequently Asked Questions

What is CWE-330: Use of Insufficiently Random Values?+

CWE-330: Use of Insufficiently Random Values is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.

What are the security consequences of Use of Insufficiently Random Values?+

If exploited, CWE-330 (Use of Insufficiently Random Values) it can compromise Confidentiality, Other and Access Control, leading to outcomes such as Other, Bypass Protection Mechanism and Gain Privileges or Assume Identity.

How do you prevent or mitigate Use of Insufficiently Random Values?+

Recommended mitigations for CWE-330 include: Use a well-vetted algorithm that is currently considered to be strong by experts in the field, and select well-tested implementations with adequate length seeds. In general, if a pseudo-random number generator is not advertised as being cryptographically secure, then it is probably a statistical PRNG and should not be used in security-sensitive contexts. Pseudo-random number generators can produce predictable numbers if the generator is known and the seed can be guessed. A 256-bit seed is a good starting point for producing a "random enough" number. Consider a PRNG that re-seeds itself as needed from high quality pseudo-random output sources, such as hardware devices. Use automated static analysis tools that target this type of weakness. Many modern techniques use data flow analysis to minimize the number of false positives. This is not a perfect solution, since 100% accuracy and coverage are not feasible.

How is Use of Insufficiently Random Values detected?+

CWE-330 can be detected using Manual Static Analysis - Source Code and Architecture or Design Review. Combining automated tooling with manual review typically yields the best coverage.

Which programming languages are affected by Use of Insufficiently Random Values?+

CWE-330 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Use of Insufficiently Random Values?+

MITRE documents real CVEs mapped to CWE-330, including CVE-2021-3692, CVE-2020-7010, CVE-2009-3278, CVE-2009-3238 and CVE-2009-2367. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-330 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More