Hacker News new | ask | show | jobs
by 8organicbits 40 days ago
Hey author here, thanks for reading the post. I haven't seen UUIDv5 used very often but I'll have to think about the idempotency angle more.

One thing that concerns me is that UUIDv5 is based on SHA1, which is an insecure hashing algorithm. I generated a pair of colliding UUIDv5s in an earlier post in this series (https://alexsci.com/blog/uuid-oops/#insecure-hash-functions). So I don't think you can use UUIDv5 for security critical functions.

1 comments

Interesting! That said, these examples appear to be crafted in a special way to cause the collision. In a practical scenario with normal usage, I suspect it would be essentially impossible. Sure, it can be a problem in some niche scenarios with a determined attacker but a collision would just mean that the user is not able to create the resource (the system would falsely indicate that the resource already exists); but that's not too bad. At worst, it would reveal the existence of a resource with a specific UUID, but could the attacker have achieved the collision if they didn't know the target UUID already? It doesn't seem like a viable attack given how little information it gives you.
Correct, this is a very specific attack where an attacker can generate UUIDv5 collisions but cannot force a collision of a chosen UUID. If your usage doesn't serve any security functions then its fine to use an insecure hash function.

One thing I find interesting is that we seem to be at the end of the road for secure hash-based UUIDs. SHA-1 was already truncated (I.E. weakened) from 160 bits to 122 bits to fit the UUID width. To fit a SHA-256 hash you'd need to throw away a majority of the bits!