This vulnerability occurs when a system uses a predictable sequence for generating values, allowing an attacker to accurately guess future numbers by analyzing past ones.
Many applications rely on random or unique values for critical tasks like generating session tokens, encryption keys, or transaction IDs. When the algorithm producing these values is not truly random—perhaps using a simple counter, a weak pseudo-random number generator (PRNG), or a time-based seed—it creates a pattern. An attacker who observes a few previous values can often deduce the algorithm and predict the next value with high accuracy, completely bypassing the intended security. This flaw is particularly dangerous in security contexts. For instance, predictable session IDs can lead to account hijacking, and guessable initial sequence numbers (ISNs) in TCP connections can enable session spoofing. To prevent this, developers must use cryptographically secure random number generators (CSPRNGs) that are explicitly designed to be unpredictable, even when previous outputs are known, and ensure seeds have sufficient entropy from a reliable system source.
Impact: Varies by Context
Strategy: Libraries or Frameworks