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: Done
    • Icon: Minor Minor
    • RHDG 8.5.1 GA
    • RHDG 8.4.6 GA
    • None
    • None
    • 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
              Pavel Drobek Pavel Drobek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: