Has Anyone Faced Issues with Math.random() in Security Audits? How Did You Handle It?

0
0
Asked By CleverPineapple42 On

I recently had a security audit that flagged the use of Math.random() for generating credentials. It turned out to be non-compliant with the NIST 800-63B standards due to insufficient entropy and lack of proper documentation to prove compliance. We revamped our credential generation process, but documenting everything retroactively took a lot of time. I'm curious about others' experiences: Are you automating compliance documentation in your workflows, or is it a manual process in your organization?

7 Answers

Answered By PragmaticWalrus On

I recommend using Node's crypto functions or other true random number generators for creating credentials. They are way better suited for this task!

Answered By CuriousRaccoon On

Larger organizations can really hamper efficiency. This was a common issue at the Fortune 50 company I worked for; processes were often overly complicated.

Answered By SkepticalBear On

I once dealt with a similar audit. I just told them to chill because it was only for displaying tiles randomly on screen and had nothing to do with system security.

Answered By ChillPenguin27 On

You can easily create a secure random number generator using crypto.randomBytes(). Just keep in mind:
- crypto.randomBytes() is meant for server-side code in Node.js.
- If you're working with browsers, use crypto.getRandomValues(), which is also available in Node.js 15 and up. Both work great but have different environments and use cases.

Answered By PunnyDolphin On

Yep, Math.random() is definitely not reliable for security. I've had to advise against its use in similar situations.

Answered By SeriousCactus88 On

You really shouldn't be using Math.random() for cryptographic purposes! It's not secure at all, as noted in the documentation. For anything security-related, switch to the Web Crypto API and use Crypto.getRandomValues() instead. That's the way to go if you want to ensure proper security!

Answered By JokesterFrog On

I hope they didn't flag Math.random() just for some UI animations! That would be a bit excessive, don’t you think?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.