Generation of Predictable Numbers or Identifiers

Incomplete Class
Structure: Simple
Description

The product uses a scheme that generates numbers or identifiers that are more predictable than required.

Common Consequences 1
Scope: Other

Impact: Varies by Context

Demonstrative Examples 1

ID : DX-45

This code generates a unique random identifier for a user's session.

Code Example:

Bad
PHP
php
Because the seed for the PRNG is always the user's ID, the session ID will always be the same. An attacker could thus predict any user's session ID and potentially hijack the session.
This example also exhibits a Small Seed Space (Small Seed Space in PRNG).
Observed Examples 3
CVE-2022-29330Product for administering PBX systems uses predictable identifiers and timestamps for filenames (Generation of Predictable Numbers or Identifiers) which allows attackers to access files via direct request (Direct Request ('Forced Browsing')).
CVE-2001-1141PRNG allows attackers to use the output of small PRNG requests to determine the internal state information, which could be used by attackers to predict future pseudo-random numbers.
CVE-1999-0074Listening TCP ports are sequentially allocated, allowing spoofing attacks.
References 1
24 Deadly Sins of Software Security
Michael Howard, David LeBlanc, and John Viega
McGraw-Hill
2010
ID: REF-44
Modes of Introduction
Architecture and Design
Implementation
Taxonomy Mapping
  • PLOVER
  • WASC
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.