Skip to content

Commit ee98c0c

Browse files
committed
Add start_tls_s() comment and use DataFlow::MethodCallNode instead
1 parent 1bc16fb commit ee98c0c

File tree

1 file changed

+6
-4
lines changed
  • python/ql/src/experimental/semmle/python/frameworks

1 file changed

+6
-4
lines changed

python/ql/src/experimental/semmle/python/frameworks/LDAP.qll

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ private module LDAP {
116116
(
117117
// ldap_connection.start_tls_s()
118118
// see https://www.python-ldap.org/en/python-ldap-3.3.0/reference/ldap.html#ldap.LDAPObject.start_tls_s
119-
exists(DataFlow::AttrRead startTLS |
119+
exists(DataFlow::MethodCallNode startTLS |
120120
startTLS.getObject().getALocalSource() = initialize and
121-
startTLS.getAttributeName() = "start_tls_s"
121+
startTLS.getMethodName() = "start_tls_s"
122122
)
123123
or
124124
// ldap_connection.set_option(ldap.OPT_X_TLS_%s, True)
@@ -221,8 +221,10 @@ private module LDAP {
221221
.flowsTo([serverCall.getArg(2), serverCall.getArgByName("use_ssl")])
222222
)
223223
or
224-
exists(DataFlow::AttrRead startTLS |
225-
startTLS.getAttributeName().matches("%start_tls%") and
224+
// ldap_connection.start_tls_s()
225+
// see https://www.python-ldap.org/en/python-ldap-3.3.0/reference/ldap.html#ldap.LDAPObject.start_tls_s
226+
exists(DataFlow::MethodCallNode startTLS |
227+
startTLS.getMethodName() = "start_tls_s" and
226228
startTLS.getObject().getALocalSource() = this
227229
)
228230
}

0 commit comments

Comments
 (0)