Predictable random number
Why it matters
rand(), mt_rand() and uniqid() are predictable. Tokens for password resets, sessions or CSRF must come from a cryptographically secure source.
$token = uniqid();
$token = bin2hex(random_bytes(32));
How to fix
For tokens and secrets use random_bytes() or random_int().
Scan my code
Scan my code β
Paste a file and PHP Safe points to every line that matches this rule.