mirror of
https://github.com/github/codeql.git
synced 2026-02-20 00:43:44 +01:00
29 lines
924 B
Plaintext
29 lines
924 B
Plaintext
/**
|
|
* @name LDAP query built from user-controlled sources
|
|
* @description Building an LDAP query from user-controlled sources is vulnerable to insertion of
|
|
* malicious LDAP code by the user.
|
|
* @kind path-problem
|
|
* @problem.severity error
|
|
* @security-severity 9.8
|
|
* @precision high
|
|
* @id py/ldap-injection
|
|
* @tags security
|
|
* external/cwe/cwe-090
|
|
*/
|
|
|
|
// Determine precision above
|
|
import python
|
|
import semmle.python.security.dataflow.LdapInjectionQuery
|
|
import DataFlow::PathGraph
|
|
|
|
from DataFlow::PathNode source, DataFlow::PathNode sink, string parameterName
|
|
where
|
|
any(DnConfiguration dnConfig).hasFlowPath(source, sink) and
|
|
parameterName = "DN"
|
|
or
|
|
any(FilterConfiguration filterConfig).hasFlowPath(source, sink) and
|
|
parameterName = "filter"
|
|
select sink.getNode(), source, sink,
|
|
"LDAP query parameter (" + parameterName + ") depends on a $@.", source.getNode(),
|
|
"user-provided value"
|