Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-1897

Automatically generated passwords (e.g. password reset) use insecure java.util.Random

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 2.0.7
    • 2.0.3
    • None
    • None

      "Reset password" calls

      • com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.resetPassword(), which calls
      • com.atlassian.crowd.integration.authentication.PasswordHelper.generateRandomPassword(), which calls
      • org.apache.commons.lang.RandomStringUtils.randomAlphanumeric(8) (link), which eventually calls
      • java.util.Random.nextInt(int) (link), which
      • uses a 48-bit seed, which is modified using a linear congruential formula. (See Donald Knuth, The Art of Computer Programming, Volume 2, Section 3.2.1.)

      Several obvious flaws:

      • What's Random() seeded with? It's often something predictable by an attacker.
      • java.util.Random() makes no attempt at being secure — knowing a given 48-bit state trivially gives you every previous and future state. The password has 47.6 log2(628) = 47.6 bits of entropy, so I just reset my password twice, crack the state, reset my password, and reset someone else's password.

      It's not that difficult to do a distributed brute-force of a 48-bit state, especially when the implementation gives you the 6.5 bits for free. There's also plenty of cryptanalysis, some of which might be relevant.

              shamid@atlassian.com shihab
              0b1305f102cb T Chan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: