Skip to content

Commit acd0f2a

Browse files
committed
Python: Move experimental LDAPInsecureAuth to new dataflow API
1 parent c6911c2 commit acd0f2a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

python/ql/src/experimental/Security/CWE-522/LDAPInsecureAuth.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
// determine precision above
1414
import python
15-
import DataFlow::PathGraph
15+
import LDAPInsecureAuthFlow::PathGraph
1616
import experimental.semmle.python.security.LDAPInsecureAuth
1717

18-
from LdapInsecureAuthConfig config, DataFlow::PathNode source, DataFlow::PathNode sink
19-
where config.hasFlowPath(source, sink)
18+
from LDAPInsecureAuthFlow::PathNode source, LDAPInsecureAuthFlow::PathNode sink
19+
where LDAPInsecureAuthFlow::flowPath(source, sink)
2020
select sink.getNode(), source, sink, "This LDAP host is authenticated insecurely."

python/ql/src/experimental/semmle/python/security/LDAPInsecureAuth.qll

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,8 @@ class LdapStringVar extends BinaryExpr {
8888
/**
8989
* A taint-tracking configuration for detecting LDAP insecure authentications.
9090
*/
91-
class LdapInsecureAuthConfig extends TaintTracking::Configuration {
92-
LdapInsecureAuthConfig() { this = "LDAPInsecureAuthConfig" }
93-
94-
override predicate isSource(DataFlow::Node source) {
91+
private module LDAPInsecureAuthConfig implements DataFlow::ConfigSig {
92+
predicate isSource(DataFlow::Node source) {
9593
source instanceof RemoteFlowSource or
9694
source.asExpr() instanceof LdapFullHost or
9795
source.asExpr() instanceof LdapBothStrings or
@@ -100,7 +98,10 @@ class LdapInsecureAuthConfig extends TaintTracking::Configuration {
10098
source.asExpr() instanceof LdapStringVar
10199
}
102100

103-
override predicate isSink(DataFlow::Node sink) {
101+
predicate isSink(DataFlow::Node sink) {
104102
exists(LdapBind ldapBind | not ldapBind.useSsl() and sink = ldapBind.getHost())
105103
}
106104
}
105+
106+
/** Global taint-tracking for detecting "LDAP insecure authentications" vulnerabilities. */
107+
module LDAPInsecureAuthFlow = TaintTracking::Global<LDAPInsecureAuthConfig>;

0 commit comments

Comments
 (0)