This vulnerability occurs when an attacker can guess or deduce sensitive values, like random numbers or identifiers, by observing predictable system or network characteristics such as timestamps, process IDs, or other public information.
This weakness undermines security by making supposedly random or secret values guessable. Instead of being truly unpredictable, these values follow a pattern or are derived from observable system state, like the current time, incrementing counters, or publicly accessible identifiers. Attackers can exploit this to predict session tokens, cryptographic nonces, or temporary file names, leading to unauthorized access or data breaches. To prevent this, developers must ensure that all security-critical values are generated using cryptographically secure random number generators (CSPRNGs) designed to resist prediction. Avoid using predictable sources like system time, process IDs, or unseeded pseudo-random functions for secrets, tokens, or initialization vectors. Always validate that randomness sources are appropriate for the security context of the feature you are building.
Impact: Varies by Context
This weakness could be exploited by an attacker in a number ways depending on the context. If a predictable number is used to generate IDs or keys that are used within protection mechanisms, then an attacker could gain unauthorized access to the system. If predictable filenames are used for storing sensitive information, then an attacker might gain access to the system and may be able to gain access to the information in the file.
Strategy: Libraries or Frameworks
php