CWE-330 / WEAKNESS
Use of Insufficiently Random Values
The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.
- Category
- CWE weaknesses
- Version / scope
- CWE 4.20; release 2026-04-30; publisher status Stable
- Affected / relevant technologies
- Not Technology-Specific / Not Language-Specific
- Evidence
- Documentation: pinned-source excerpt checked. Execution: not tested. Editorial: curated reference.
Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.
Mechanism and prerequisites
No separate exploit prerequisites are asserted here; the publisher's weakness/pattern context must be matched to the implementation.
Potential impact
Confidentiality Other 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. Access Control Other Bypass Protection Mechanism Other If product relies on unique, unguessable IDs to identify a resource, an attacker might be able to guess an ID for a resource that is owned by another user. The attacker could then read the resource, or pre-create a resource with the same ID to prevent the legitimate program from properly sending the resource to the intended user. For example, a product might maintain session information in a file whose name is based on a username. An attacker could pre-create this file for a victim user, then set the permissions so that the application cannot generate the session for the victim, preventing the victim from using the application. Access Control Bypass Protection Mechanism Gain Privileges or Assume Identity When an authorization or authentication mechanism relies on random values to restrict access to restricted functionality, such as a session ID or a seed for generating a cryptographic key, then an attacker may access the restricted functionality by guessing the ID or key.
Versioned source scope
This record contains normalized, sometimes shortened source excerpts with editorial safety context. Markup and executable example blocks are omitted. Source-field verification does not establish device testing, a working detector or local applicability.
Publisher: MITRE. Release: CWE 4.20; release 2026-04-30; publisher status Stable. Source checked: 2026-11-18.
Source object: CWE-330. Object modified: 2026-04-30.
Attribution and source terms (© The MITRE Corporation; reproduced with permission)Detection and investigation
- Black Box Use monitoring tools that examine the software's process as it interacts with the operating system and the network. This technique is useful in cases when source code is unavailable, if the software was not developed by you, or if you want to verify that the build phase did not introduce any new weaknesses. Examples include debuggers that directly attach to the running process; system-call tracing utilities such as truss (Solaris) and strace (Linux); system activity monitors such as FileMon, RegMon, Process Monitor, and other Sysinternals utilities (Windows); and sniffers and protocol analyzers that monitor network traffic. Attach the monitor to the process and look for library functions that indicate when randomness is being used. Run the process multiple times to see if the seed changes. Look for accesses of devices or equivalent resources that are commonly used for strong (or weak) randomness, such as /dev/urandom on Linux. Look for library or system calls that access predictable information such as process IDs and system time.
- Automated Static Analysis - Binary or Bytecode According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Bytecode Weakness Analysis - including disassembler + source code weakness analysis Binary Weakness Analysis - including disassembler + source code weakness analysis SOAR Partial
- Manual Static Analysis - Binary or Bytecode According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies SOAR Partial
- Dynamic Analysis with Manual Results Interpretation According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Man-in-the-middle attack tool SOAR Partial
Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.
Mitigation and response
- Architecture and Design 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.
- Implementation Consider a PRNG that re-seeds itself as needed from high quality pseudo-random output sources, such as hardware devices.
- Architecture and Design Requirements 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").
Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.
Related technical context
No protocol-specific mapping is asserted for this entry.
Related security reading
Continue directly to another reference. Editorial reading connections do not assert official CWE/CAPEC/ATT&CK/OWASP equivalence or mappings.
Publisher-defined relationships
These directed relationships come from the pinned publisher data. They describe framework context, not guaranteed prevention, detection coverage or equivalence between entities.
Publisher weakness and attack-pattern relationships
These relationships retain the publisher's source attributes and view context; they do not establish that an attack or weakness applies to a particular system.
- CAPEC-112 → Related_Weakness → CWE-330 Open related reference
- CAPEC-485 → Related_Weakness → CWE-330 Open related reference
- CAPEC-59 → Related_Weakness → CWE-330 Open related reference
- CWE-1204 → ChildOf → CWE-330 Open related reference
- CWE-1241 → ChildOf → CWE-330 Open related reference
- CWE-330 → Related_Attack_Pattern → CAPEC-112 Open related reference
- CWE-330 → Related_Attack_Pattern → CAPEC-485 Open related reference
- CWE-330 → Related_Attack_Pattern → CAPEC-59 Open related reference
- CWE-330 → ChildOf → CWE-693 Open related reference
- CWE-330 → CanPrecede → CWE-804 Open related reference
- CWE-331 → ChildOf → CWE-330 Open related reference
- CWE-331 → ChildOf → CWE-330 Open related reference
- CWE-334 → ChildOf → CWE-330 Open related reference
- CWE-335 → ChildOf → CWE-330 Open related reference
- CWE-335 → ChildOf → CWE-330 Open related reference
- CWE-338 → ChildOf → CWE-330 Open related reference
- CWE-338 → ChildOf → CWE-330 Open related reference
- CWE-340 → ChildOf → CWE-330 Open related reference
- CWE-344 → ChildOf → CWE-330 Open related reference
Authoritative sources and attribution
Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Source excerpts are attributed and adapted under the linked publisher license; editorial context is separate. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.
- Publisher reference: CWE-330 — source accessed 2026-11-18
- cwe — source accessed 2026-11-18
Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.
