1 Predictable Pseudo-Random Generators
Standard random number generators (Math.random, rand(), random.random) are designed for statistical randomness — not unpredictability. They use deterministic algorithms seeded from predictable values like the current time, making security-sensitive output guessable.
Vulnerable examples:
// JavaScript — Math.random() is NOT cryptographically secure
const token = Math.random().toString(36).substring(2); // Predictable!// PHP — rand() or mt_rand() are predictable
$token = md5(rand()); // Very predictable with known seed!# Python — random module is predictable (Mersenne Twister)
import random
token = random.randint(0, 10**16) # Guessable after observing outputsImpact: Predictable tokens enable attackers to guess password reset links, CSRF tokens, session IDs, or API keys generated with insecure randomness. An attacker who can observe any output from the PRNG can predict future and past values.