1
1
/**
2
- * Provides a taint-tracking configuration for detecting LDAP injection vulnerabilities
2
+ * Provides taint-tracking configurations for detecting LDAP injection vulnerabilities
3
+ *
4
+ * Note, for performance reasons: only import this file if
5
+ * `LdapInjection::Configuration` is needed, otherwise
6
+ * `LdapInjectionCustomizations` should be imported instead.
3
7
*/
4
8
5
9
import python
@@ -8,9 +12,20 @@ import semmle.python.dataflow.new.DataFlow
8
12
import semmle.python.dataflow.new.TaintTracking
9
13
import semmle.python.dataflow.new.RemoteFlowSources
10
14
15
+ /**
16
+ * Provides aint-tracking configurations for detecting LDAP injection vulnerabilities.class
17
+ *
18
+ * Two configurations are provided. One is for detecting LDAP injection
19
+ * via the distinguished name (DN). The other is for detecting LDAP injection
20
+ * via the filter. These require different escapings.
21
+ */
11
22
module LdapInjection {
12
23
import LdapInjectionCustomizations:: LdapInjection
13
24
25
+ /**
26
+ * A taint-tracking configuration for detecting LDAP injection vulnerabilities
27
+ * via the distinguished name (DN) parameter of an LDAP search.
28
+ */
14
29
class DnConfiguration extends TaintTracking:: Configuration {
15
30
DnConfiguration ( ) { this = "LdapDnInjection" }
16
31
@@ -25,6 +40,10 @@ module LdapInjection {
25
40
}
26
41
}
27
42
43
+ /**
44
+ * A taint-tracking configuration for detecting LDAP injection vulnerabilities
45
+ * via the filter parameter of an LDAP search.
46
+ */
28
47
class FilterConfiguration extends TaintTracking:: Configuration {
29
48
FilterConfiguration ( ) { this = "LdapFilterInjection" }
30
49
@@ -41,6 +60,7 @@ module LdapInjection {
41
60
42
61
import DataFlow:: PathGraph
43
62
63
+ /** Holds if there is an LDAP injection from `source` to `sink` */
44
64
predicate ldapInjection ( DataFlow:: PathNode source , DataFlow:: PathNode sink ) {
45
65
any ( DnConfiguration dnConfig ) .hasFlowPath ( source , sink )
46
66
or
0 commit comments