CWEweakness

CWE-332 Insufficient Entropy in PRNG

Medium Official page ↗
Abstraction
Variant
Structure
Simple
Status
Draft
Likelihood of exploit
Medium
Languages
Not Language-Specific
CWE version
5.0

Description

The lack of entropy available for, or used by, a Pseudo-Random Number Generator (PRNG) can be a stability and security threat.

Common consequences

• Availability: DoS: Crash, Exit, or Restart — If a pseudo-random number generator is using a limited entropy source which runs out (if the generator fails closed), the program may pause or crash. • Access Control, Other: Bypass Protection Mechanism, Other — If a PRNG is using a limited entropy source which runs out, and the generator fails open, the generator could produce predictable random numbers. Potentially a weak source of random numbers could weaken the encryption method used for authentication of users.

Potential mitigations

• [Architecture and Design, Requirements] 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"). • [Implementation] Consider a PRNG that re-seeds itself as needed from high-quality pseudo-random output, such as hardware devices. • [Architecture and Design] When deciding which PRNG to use, look at its sources of entropy. Depending on what your security needs are, you may need to use a random number generator that always uses strong random data -- i.e., a random number generator that attempts to be strong but will fail in a weak way or will always provide some middle ground of protection through techniques like re-seeding. Generally, something that always provides a predictable amount of strength is preferable.

Detection methods

• Automated Static Analysis: 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.)

Observed examples

• [REF-1374]: Chain: JavaScript-based cryptocurrency library can fall back to the insecure Math.random() function instead of reporting a failure (CWE-392), thus reducing the entropy (CWE-332) and leading to generation of non-unique cryptographic keys for Bitcoin wallets (CWE-1391) • CVE-2019-1715: security product has insufficient entropy in the DRBG, allowing collisions and private key discovery

Related

Observed example · CVE (1)

  • CVE-2019-1715 A vulnerability in the Deterministic Random Bit Generator (DRBG), also known as Pseudorandom Number Generator (PRNG), used in Cisco… vulnerability

Child of · CWE (1)

  • CWE-331 Insufficient Entropy weakness

Referenced by CVE · weakness (10)

  • CVE-2026-3290 Timing limitations of the HRNG in RS9116 when power save mode is enabled results in predictable values vulnerability
  • CVE-2023-20107 A vulnerability in the deterministic random bit generator (DRBG), also known as pseudorandom number generator (PRNG), in Cisco Adaptive… vulnerability
  • CVE-2017-18486 Jitbit Helpdesk before 9.0.3 allows remote attackers to escalate privileges because of mishandling of the User/AutoLogin userHash parameter. vulnerability
  • CVE-2019-1715 A vulnerability in the Deterministic Random Bit Generator (DRBG), also known as Pseudorandom Number Generator (PRNG), used in Cisco… vulnerability
  • CVE-2016-10743 hostapd before 2.6 does not prevent use of the low-quality PRNG that is reached by an os_random() function call. vulnerability
  • CVE-2018-9057 aws/resource_aws_iam_user_login_profile.go in the HashiCorp Terraform Amazon Web Services (AWS) provider through v1.12.0 has an… vulnerability
  • CVE-2017-9371 In BlackBerry QNX Software Development Platform (SDP) 6.6.0 and 6.5.0 SP1 and earlier, a loss of integrity vulnerability in the default… vulnerability
  • CVE-2014-9690 Huawei home gateways WS318 with software V100R001C01B022 and earlier versions are affected by the PIN offline brute force cracking… vulnerability
  • CVE-2016-9154 Siemens Desigo PX Web modules PXA40-W0, PXA40-W1, PXA40-W2 for Desigo PX automation controllers PXC00-E.D, PXC50-E.D, PXC100-E.D,… vulnerability
  • CVE-2014-0016 stunnel before 5.00, when using fork threading, does not properly update the state of the OpenSSL pseudo-random number generator (PRNG),… vulnerability

Referenced by OWASP · mapped cwe (1)

  • A04:2025 Cryptographic Failures Top 10 2025