Skip to content

Randomness in UUID generation is insufficient. #9881

Open

Description

@dlangBugzillaToGithub

jdougan reported this on 2024-11-25T00:53:20Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=24877

Description

UUIDs generated by randomUUID() use the random numbers from std.random, granted with an unpredictableSeed, but from a fundamentally insecure and low entropy source.

As per the latest UUID RFC, RFC-8562, Section 8 this should at least have the option of using an actual quality entropy source.

https://www.rfc-editor.org/rfc/rfc9562.html in section 8 says:

"Instead CSPRNG data SHOULD be selected from a source with sufficient entropy to ensure guaranteed uniqueness among UUID generation."

Activity

  1. dlangBugzillaToGithub commented on Nov 25, 2024

    @dlangBugzillaToGithub
    Author

    dfj1esp02 commented on 2024-11-25T09:49:06Z

    There's an overload that accepts an RNG
    ---
    UUID randomUUID(RNG)(ref RNG randomGen);
    ---
  2. dlangBugzillaToGithub commented on Nov 26, 2024

    @dlangBugzillaToGithub
    Author

    jdougan commented on 2024-11-26T04:32:30Z

    and no cryptographic streng RNG to use with it.
    
    https://breakpoint.purrfect.fr/article/cracking_phobos_uuid.html
  3. added 2 commits that reference this issue on Mar 15, 2025
  4. added a commit that references this issue on Mar 17, 2025
  5. trikko commented on Apr 30, 2025

    @trikko
    Contributor
  6. denizzzka commented on Apr 30, 2025

    @denizzzka
    Contributor

    It would be great to be able to manipulate with UUIDv7 with Phobos

  7. 0xEAB commented on May 1, 2025

    @0xEAB
    Member

    #10748 should allow us to resolve the randomness issue.

    Regarding support for UUIDv7, it might be worth opening a separate issue for that enhancement.

  8. added a commit that references this issue on Jun 5, 2025
  9. denizzzka commented on Sep 14, 2025

    @denizzzka
    Contributor

    UUIDv7 randomness check failure: #10865
    This makes UUIDv7 completely unusable

  10. added theissue type on Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions