Skip to content

Commit 4a2c99a

Browse files
committed
Python: Inline LDAPImproperAuth.qll
Since having it inlined makes the query a bit easier to read. We obviously need to share it if we want to share this predicate, but for now that does not seem to be the case.
1 parent b33f6a3 commit 4a2c99a

File tree

2 files changed

+14
-22
lines changed

2 files changed

+14
-22
lines changed

python/ql/src/experimental/Security/CWE-287/ImproperLdapAuth.ql

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,20 @@
1111

1212
// Determine precision above
1313
import python
14-
import experimental.semmle.python.security.LDAPImproperAuth
14+
import experimental.semmle.python.Concepts
15+
import semmle.python.dataflow.new.DataFlow
16+
17+
predicate authenticatesImproperly(LDAPBind ldapBind) {
18+
(
19+
DataFlow::localFlow(DataFlow::exprNode(any(None noneName)), ldapBind.getPassword()) or
20+
not exists(ldapBind.getPassword())
21+
)
22+
or
23+
exists(StrConst emptyString |
24+
emptyString.getText() = "" and
25+
DataFlow::localFlow(DataFlow::exprNode(emptyString), ldapBind.getPassword())
26+
)
27+
}
1528

1629
from LDAPBind ldapBind
1730
where authenticatesImproperly(ldapBind)

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

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)