5 ms·
>So, the lesson for today is: take warnings in documentation seriously. If you used UUID() for data that is supposed to be secret (like passwords), you have a s
by gruez 8y ago
>So, the lesson for today is: take warnings in documentation seriously. If you used UUID() for data that is supposed to be secret (like passwords), you have a serious problem, as these secrets can now be easily guessed.
No, the lesson here is to not assume a "random" function is cryptographically secure unless stated otherwise. The same article could be made about Math.random or rand.
- hn_throwaway_99 8y agoBut the main problem is that he thinks UUIDs are supposed to be random when they're not - their only guarantee is uniqueness. MySQL uses (IIRC) V1 UUIDs, which combine a MAC address with time, while only V4 UUIDs are random.
- ben509 8y agoThe MAC address is a worse problem, honestly, than that they're not random. That means your database is leaking information about which host generated the UUID, which would be useful to someone trying to exploit a particular host. Or if you have an application installed on personal machines, it's leaking identifying information about those machines.
- hn_throwaway_99 8y agoThis is true. I wish I could find the article but years ago I remember malicious hackers that were identified by law enforcement because their virus included some windows guids, which at the time included the Mac address.
- sgerenser 8y agoProbably thinking about the Melissa Virus: http://archive.arstechnica.com/wankerdesk/2q99/melissa-1.html http://archive.arstechnica.com/wankerdesk/2q99/melissa-1.htm...
- the_mitsuhiko 8y agoBecause 3 and 5 are based on hashes they will be random as well unless you know what the input value was.
- gnu8 8y agoI agree with the author, the lesson really is to take the documentation seriously. I think a lot of people might not be in the habit of doing that, because they find the documentation of many projects lacking, or because it’s easier just to read some walkthrough where the work is already done and they can just copy paste the commands. It’s important to fully understand what you are doing in all cases, not just ones touching cryptography.