Skip to content

Commit 7e45649

Browse files
committed
Set up taint config and custom sink
1 parent 8ca6e84 commit 7e45649

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed
Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
1+
import python
2+
import experimental.semmle.python.Concepts
3+
import semmle.python.dataflow.new.DataFlow
4+
import semmle.python.dataflow.new.TaintTracking
5+
import semmle.python.dataflow.new.RemoteFlowSources
16

2-
//
7+
class LDAPImproperAuthSink extends DataFlow::Node {
8+
LDAPImproperAuthSink() {
9+
exists(LDAPBind ldapBind |
10+
(
11+
DataFlow::localFlow(DataFlow::exprNode(any(None noneName)), ldapBind.getPasswordNode()) or
12+
not exists(ldapBind.getPasswordNode())
13+
) and
14+
this = ldapBind.getQueryNode()
15+
)
16+
}
17+
}
18+
19+
class LDAPImproperAuthenticationConfig extends TaintTracking::Configuration {
20+
LDAPImproperAuthenticationConfig() { this = "LDAPImproperAuthenticationConfig" }
21+
22+
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
23+
24+
override predicate isSink(DataFlow::Node sink) { sink instanceof LDAPImproperAuthSink }
25+
}

0 commit comments

Comments
 (0)