Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-6792

[GSS](8.4.z) StringIndexOutOfBoundsException if users.properties is malformed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • RHDG 8.4.6 GA
    • None
    • None
    • False
    • None
    • False
    • Moderate

      If users.properties is in encrypted form, but there's an invalid entry it causes a StringIndexOutOfBoundsException instead of more clear error message.
       
      Correct format (if it had a correct hash):

      user=scram-sha-1\:aaaaaaaaaa;

      Bad format:

      user=aaaaaaaaa

      The issue is in org.infinispan.server.security.realm.EncryptedPropertiesSecurityRealm#load.

          int colon = password.indexOf(':');
          PasswordFactory factory = getPasswordFactory(password.substring(0, colon));
      

      It looks for a colon, but does not verify it actualy found one before calling substring with an invalid index.
      It should check If colon == -1 and return a more descriptive error message.

            ttarrant@redhat.com Tristan Tarrant
            rhn-support-dereed Dennis Reed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: