Insecure Randomness: Custom Algorithms

OtherExploitation

From PayloadsAllTheThings by Swissky and contributors, under the MIT licence. Shown as written; the title and classification are ours. Licences. Its authors can have this tip removed by writing to abuse@bugbountytips.org.

Creating your own randomness algorithm is generally not recommended. Below are some examples found on GitHub or StackOverflow that are sometimes used in production, but may not be reliable or secure.

  • $token = md5($emailId).rand(10,9999);

  • $token = md5(time()+123456789 % rand(4000, 55000000));

Comments

No comments yet.