CWE-330: CWE-330: Use of Insufficiently Random Values

ClassStable

Description

View on MITRE
Back to CWE Lookup

Technical Details

Structure
Simple
Vulnerability Mapping
DISCOURAGED

Applicable To

Languages
Languages
Platforms
Languages

Frequently Asked Questions

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

CWE-330: CWE-330: Use of Insufficiently Random Values is a Common Weakness Enumeration (CWE) entry maintained by MITRE. Description

What are the security consequences of CWE-330: Use of Insufficiently Random Values?+

If exploited, CWE-330 (CWE-330: Use of Insufficiently Random Values) it can compromise Other, Bypass Protection Mechanism and Gain Privileges or Assume Identity, leading to outcomes such as Scope: Confidentiality, Other When a protection mechanism relies on random values to restrict access to a sensitive resource, such as a session ID or a seed for generating a cryptographic key, then the resource being protected could be accessed by guessing the ID or key., Scope: Access Control and Other If product relies on unique.

How do you prevent or mitigate CWE-330: 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. Strategy: Libraries or Frameworks Use products or modules that conform to FIPS 140-2 [ REF-267 ] to avoid obvious entropy problems. Consult FIPS 140-2 Annex C ("Approved Random Number Generators").

Which programming languages are affected by CWE-330: Use of Insufficiently Random Values?+

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

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

Advertisement