Remix.run Logo
▲ ThePhysicist 39 minutes ago

It's such a simple mistake that you and LLM review can miss if not specifically looking for it, especially if it's in a dependency. Lots of folks don't know that Math.random() is insecure and they should be using Crypto.getRandomValue(), it's mostly bad language design, from an age where security was just an afterthought even more so than today. For LLMs it's trivial to find such instances.

That said any good security audit would have turned this up well before the age of LLMs, we were checking for weak RNG values first thing when looking at a new codebase as it was often an easy finding along with e.g. weak hashing algorithms like MD5 or SHA1. I believe a lot of static analysis code scanning tools have rules that flag Math.random() as insecure as well.

▲nsbdhciebsbdhc 20 minutes ago | parent [-]

Let's not forget that crypto.getrandomvalue requires https which can force developers not using local https to use the insecure methods which they inevitably forget to update before shipping, all in the name of security by our great browser overloards and their infinite wisdom.

▲ronsor 5 minutes ago | parent [-]

"http://localhost:*" and "http://\*.localhost:\*" are considered a secure origin, so you don't need HTTPS for it.