Weak Random Number Generator for Auth Tokens
The library uses Math.random() for authentication tokens, which is not cryptographically secure; the text does not show an attack.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 13 days
- Disclosed after 13 days
Math.random() is not sufficient for cryptographic purposes (such as authentication tokens).
An example replacement that uses window.crypto.getRandomValues() is available here:
Further information: https://media.blackhat.com/us-13/US-13-Soeder-Black-Box-Assessment-of-Pseudorandom-Algorithms-WP.pdf
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
What the attacker needed
None
The fix
Replace Math.random() with a cryptographically secure random number generator such as window.crypto.getRandomValues().
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Math.random() produces numbers that are not suitable for cryptographic use. Authentication tokens need to be unpredictable, so using Math.random() for tokens is unsafe.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.