As of Java 1.8u51+ (also 1.7.0_85+ and 1.6.0_101+) making SSL connections to an IP address is no longer allowed. Previously the JVM would do a reverse lookup of the hostname using the IP then complete the connection using that hostname. This was a security vulnerability because an attacker that gained control of DNS could route traffic to their own server. This change is a security feature of Java.
We have found there is a problem with the way Java creates LDAPS connections. The way Socket.createSocket() is used results in an SSLSocket without the hostname set in it. This results in use of an IP address to make the connection and since this is no longer allowed the connection fails. We have reported this problem to Oracle and also forwarded the information to the Java security dev list: http://mail.openjdk.java.net/pipermail/security-dev/2015-September/012845.html .
Because of this existing LDAPS connections are broken and users from that user directory are unable to login including non-local administrators.
This will affect any customer using secure LDAP that upgrades the JVM. Secure LDAP is very common to protect passwords on the internal network, particularly in enterprise environments. This is exacerbated by JIRA 6.4.11 which ships with 1.8u51.
- Verified: JIRA 6.3+ using the noted Java versions.
- Suspected: All versions of JIRA using a noted Java version.
- Configure a user directory using a secure LDAP connection
- Upgrade the JDK to a noted Java version.
Logins and LDAP syncs should work as normal.
Users will be unable to authenticate and LDAP syncs will fail.
Errors like this will occur in the logs:
Crowd is resolving DNS name into IP and then connects to LDAP server using the IP instead of the hostname. As a result, the underlying Java code tries to compare the destination IP with the DN in the certificate.
If this is verified as the cause then the same issue will occur when the reverse-lookup IP doesn't match DN in certificate (DNS1 -> IP -> DNS2). This situation is quite common.
Java version 1.8u65 contains a fix JDK-8133196 which addresses the problem described in this issue. Please see How to Use System JRE Instead of Embedded JRE for instructions to change the version of Java that JIRA runs with.
Only necessary if you do not upgrade your Java JDK. If your version of JIRA does not support Java 8 or you cannot upgrade to 1.8u65 a workaround is necessary.
This reverts back to the older Java behavior while preserving all the other security related changes in the newer Java release. Your LDAP data will still be encrypted. The risk is described by Oracle in their explanation of the change at http://www.oracle.com/technetwork/java/javase/8u51-relnotes-2587590.html.
Under the LDAP connection "Advanced Settings" set "Secure SSL" to disabled*. As stated in the UI this will disable all verification of the SSL certificate. Your LDAP data will still be encrypted. This workaround may represent a greater vulnerability as any SSL cert could be substituted with no need to compromise a DNS server.