mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Update qldoc and test method
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
|
||||
<overview>
|
||||
<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>
|
||||
<p>Instead of addressing the issue properly by having a compliant certificate deployed, frequently developers simply disable LDAPS endpoint check.</p>
|
||||
<p>Failing to validate the certificate makes the SSL session susceptible to a man-in-the-middle attack. This query checks whether LDAPS endpoint check is disabled in system properties.</p>
|
||||
<p>Instead of addressing the issue properly by having a compliant certificate deployed, frequently developers simply disable the LDAPS endpoint check.</p>
|
||||
<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>
|
||||
</overview>
|
||||
|
||||
<recommendation>
|
||||
|
||||
@@ -32,7 +32,7 @@ class SetPropertyMethod extends Method {
|
||||
}
|
||||
}
|
||||
|
||||
/** The method to set system properties. */
|
||||
/** The `setProperties` method declared in `java.lang.System`. */
|
||||
class SetSystemPropertiesMethod extends Method {
|
||||
SetSystemPropertiesMethod() {
|
||||
this.hasName("setProperties") and
|
||||
@@ -40,7 +40,7 @@ class SetSystemPropertiesMethod extends Method {
|
||||
}
|
||||
}
|
||||
|
||||
/** Holds if an expression is evaluated to the string literal `com.sun.jndi.ldap.object.disableEndpointIdentification`. */
|
||||
/** Holds if `expr` is evaluated to the string literal `com.sun.jndi.ldap.object.disableEndpointIdentification`. */
|
||||
predicate isPropertyDisableLdapEndpointId(Expr expr) {
|
||||
expr.(CompileTimeConstantExpr).getStringValue() =
|
||||
"com.sun.jndi.ldap.object.disableEndpointIdentification"
|
||||
@@ -72,7 +72,8 @@ predicate isBooleanTrue(Expr expr) {
|
||||
|
||||
/** Holds if `ma` is in a test class or method. */
|
||||
predicate isTestMethod(MethodAccess ma) {
|
||||
ma.getMethod() instanceof TestMethod or
|
||||
ma.getEnclosingCallable() instanceof TestMethod or
|
||||
ma.getEnclosingCallable().getDeclaringType() instanceof TestClass or
|
||||
ma.getEnclosingCallable().getDeclaringType().getPackage().getName().matches("%test%") or
|
||||
ma.getEnclosingCallable().getDeclaringType().getName().toLowerCase().matches("%test%")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user