@@ -18,23 +18,37 @@ abstract class LdapAuthSink extends DataFlow::Node { }
18
18
abstract class LdapSanitizer extends DataFlow:: Node { }
19
19
20
20
/**
21
- * A vulnerable argument to `go-ldap` or `ldap`'s `NewSearchRequest ` function.
21
+ * A vulnerable argument to `go-ldap` or `ldap`'s `bind ` function (Only v2) .
22
22
*/
23
23
private class GoLdapBindSink extends LdapAuthSink {
24
24
GoLdapBindSink ( ) {
25
25
exists ( Method meth , string base , string t , string m |
26
26
t = [ "Conn" ] and
27
- meth .hasQualifiedName ( [
28
- "github.com/go-ldap/ldap" , "github.com/go-ldap/ldap/v3" , "gopkg.in/ldap.v2" ,
29
- "gopkg.in/ldap.v3"
30
- ] , t , m ) and
27
+ meth .hasQualifiedName ( [ "gopkg.in/ldap.v2" ] , t , m ) and
31
28
this = meth .getACall ( ) .getArgument ( 1 )
32
29
|
33
30
base = [ "Bind" ] and m = base
34
31
)
35
32
}
36
33
}
37
34
35
+ /**
36
+ * A vulnerable argument to `go-ldap` or `ldap`'s `UnauthenticatedBind` function (Only v3).
37
+ */
38
+ private class GoLdapAnonymousBindSink extends LdapAuthSink {
39
+ GoLdapAnonymousBindSink ( ) {
40
+ exists ( Method meth , string base , string t , string m |
41
+ t = [ "Conn" ] and
42
+ meth .hasQualifiedName ( [
43
+ "github.com/go-ldap/ldap" , "github.com/go-ldap/ldap/v3" , "gopkg.in/ldap.v3"
44
+ ] , t , m ) and
45
+ this = meth .getACall ( ) .getArgument ( 0 )
46
+ |
47
+ base = [ "UnauthenticatedBind" ] and m = base
48
+ )
49
+ }
50
+ }
51
+
38
52
/**
39
53
* A call to a regexp match function, considered as a barrier guard for sanitizing untrusted URLs.
40
54
*
0 commit comments