Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-582

<potential bug in password comparison

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-RC2
    • None
    • None
    • None

    Description

      While stepping throgh the Bind code base, I saw that the password is compared using its byte[] representation :

      userPassword = ( ( String ) userPassword ).getBytes();
      ...
      credentialsMatch = ArrayUtils.isEquals( creds, userPassword );

      in SimpleAuthenticator class. The problem is that ( ( String ) userPassword ).getBytes() may returns a wrong string if the password contains UTF-8 chars but the local encoding is not UTF-8 (W$ users, mainly, who use ISO-8859-1)

      This line should be : userPassword = StringTools.getBytesUtf8( ( String ) userPassword );

      Of course, the password must be contained in a UTF-8 file (server.xml must be declared as UTF-8 encoded)

      Attachments

        Activity

          People

            elecharny Emmanuel Lécharny
            elecharny Emmanuel Lécharny
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: