Skip to content

Commit 57953c5

Browse files
committed
Update qldoc
1 parent e698ee7 commit 57953c5

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

java/ql/src/experimental/Security/CWE/CWE-297/InsecureLdapEndpoint.qhelp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,27 @@
44
<qhelp>
55

66
<overview>
7-
<p>Java versions 8u181 or greater have enabled LDAPS endpoint identification by default. Nowadays infrastructure services like LDAP are commonly deployed behind load balancers therefore the LDAP server name can be different from the FQDN of the LDAPS endpoint. If a service certificate does not properly contain a matching DNS name as part of the certificate, Java will reject it by default.</p>
8-
<p>Instead of addressing the issue properly by having a compliant certificate deployed, frequently developers simply disable the LDAPS endpoint check.</p>
9-
<p>Failing to validate the certificate makes the SSL session susceptible to a man-in-the-middle attack. This query checks whether the LDAPS endpoint check is disabled in system properties.</p>
7+
<p>Java versions 8u181 or greater have enabled LDAPS endpoint identification by default. Nowadays
8+
infrastructure services like LDAP are commonly deployed behind load balancers therefore the LDAP
9+
server name can be different from the FQDN of the LDAPS endpoint. If a service certificate does not
10+
properly contain a matching DNS name as part of the certificate, Java will reject it by default.</p>
11+
<p>Instead of addressing the issue properly by having a compliant certificate deployed, frequently
12+
developers simply disable the LDAPS endpoint check.</p>
13+
<p>Failing to validate the certificate makes the SSL session susceptible to a man-in-the-middle attack.
14+
This query checks whether the LDAPS endpoint check is disabled in system properties.</p>
1015
</overview>
1116

1217
<recommendation>
13-
<p>Replace any non-conforming LDAP server certificates to include a DNS name in the subjectAltName field of the certificate that matches the FQDN of the service.</p>
18+
<p>Replace any non-conforming LDAP server certificates to include a DNS name in the subjectAltName field
19+
of the certificate that matches the FQDN of the service.</p>
1420
</recommendation>
1521

1622
<example>
17-
<p>The following two examples show two ways of configuring LDAPS endpoint. In the 'BAD' case,
18-
endpoint check is disabled. In the 'GOOD' case, endpoint check is left enabled through the default Java configuration.</p>
23+
<p>The following two examples show two ways of configuring LDAPS endpoint. In the 'BAD' case,
24+
endpoint check is disabled. In the 'GOOD' case, endpoint check is left enabled through the
25+
default Java configuration.</p>
1926
<sample src="InsecureLdapEndpoint.java" />
20-
<sample src="InsecureLdapEndpoint2.java" />>
27+
<sample src="InsecureLdapEndpoint2.java" />
2128
</example>
2229

2330
<references>

java/ql/src/experimental/Security/CWE/CWE-297/InsecureLdapEndpoint.ql

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/**
22
* @name Insecure LDAPS Endpoint Configuration
3-
* @description Java application configured to disable LDAPS endpoint identification does not validate the SSL certificate to properly ensure that it is actually associated with that host.
3+
* @description Java application configured to disable LDAPS endpoint identification does not validate
4+
* the SSL certificate to properly ensure that it is actually associated with that host.
45
* @kind problem
56
* @id java/insecure-ldaps-endpoint
67
* @tags security
@@ -23,7 +24,8 @@ class TypeHashtable extends Class {
2324
}
2425

2526
/**
26-
* The method to set Java properties either through `setProperty` declared in the class `Properties` or `put` declared in its parent class `HashTable`.
27+
* The method to set Java properties either through `setProperty` declared in the class `Properties`
28+
* or `put` declared in its parent class `HashTable`.
2729
*/
2830
class SetPropertyMethod extends Method {
2931
SetPropertyMethod() {
@@ -40,7 +42,10 @@ class SetSystemPropertiesMethod extends Method {
4042
}
4143
}
4244

43-
/** Holds if `expr` is evaluated to the string literal `com.sun.jndi.ldap.object.disableEndpointIdentification`. */
45+
/**
46+
* Holds if `Expr` expr is evaluated to the string literal
47+
* `com.sun.jndi.ldap.object.disableEndpointIdentification`.
48+
*/
4449
predicate isPropertyDisableLdapEndpointId(Expr expr) {
4550
expr.(CompileTimeConstantExpr).getStringValue() =
4651
"com.sun.jndi.ldap.object.disableEndpointIdentification"

0 commit comments

Comments
 (0)