Uploaded image for project: 'WildFly Elytron'
  1. WildFly Elytron
  2. ELY-2422

Update SaltedSimpleDigestPasswordImpl to make use of MessageDigest#isEqual to avoid a potential timing attack

XMLWordPrintable

      There’s 2 places in https://github.com/wildfly-security/wildfly-elytron/blob/1.x/password/impl/src/main/java/org/wildfly/security/password/impl/SaltedSimpleDigestPasswordImpl.java where Arrays#equals is currently used to compare digests.

      Arrays#equals is vulnerable to timing attacks because it uses a non time-constant comparison.

      MessageDigest#isEqual uses a time-constant comparison which means that all bytes in the arrays will be compared.

      Update SaltedSimpleDigestPasswordImpl so that it uses the MessageDigest#isEqual method instead of Arrays#equals to compare the digests.

            rh-ee-carodrig Cameron Rodriguez (Inactive)
            fjuma1@redhat.com Farah Juma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: