Predictable Value Range from Previous Values

Draft Base
Structure: Simple
Description

This vulnerability occurs when a system's random number generator produces values that, after observing previous outputs, allow an attacker to predict a limited range for the next value.

Extended Description

A secure random number generator should produce completely unpredictable sequences. When outputs follow a detectable pattern or trend—even if the exact next number isn't known—attackers can drastically reduce the number of possibilities they need to test in a brute-force attack. For example, if a generator always produces increasing numbers between 1 and 100, and the last observed value was 80, an attacker knows the next value must be between 81 and 100. Instead of testing 100 possibilities, they only need to try 20, making the system far easier to compromise.

Common Consequences 1
Scope: Other

Impact: Varies by Context

Potential Mitigations 3
Increase the entropy used to seed a PRNG.
Phase: Architecture and DesignRequirements

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").
Phase: Implementation
Use a PRNG that periodically re-seeds itself using input from high-quality sources, such as hardware devices with high entropy. However, do not re-seed too frequently, or else the entropy source might block.
References 3
FIPS PUB 140-2: SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES
Information Technology Laboratory, National Institute of Standards and Technology
25-05-2001
ID: REF-267
Strange Attractors and TCP/IP Sequence Number Analysis
Michal Zalewski
2001
ID: REF-320
24 Deadly Sins of Software Security
Michael Howard, David LeBlanc, and John Viega
McGraw-Hill
2010
ID: REF-44
Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Modes of Introduction
Architecture and Design
Implementation
Taxonomy Mapping
  • PLOVER
Notes
MaintenanceAs of CWE 4.5, terminology related to randomness, entropy, and predictability can vary widely. Within the developer and other communities, "randomness" is used heavily. However, within cryptography, "entropy" is distinct, typically implied as a measurement. There are no commonly-used definitions, even within standards documents and cryptography papers. Future versions of CWE will attempt to define these terms and, if necessary, distinguish between them in ways that are appropriate for different communities but do not reduce the usability of CWE for mapping, understanding, or other scenarios.