我有一个服务,使用LDAP目录(匿名绑定)来获取用户和他们的密码,以执行身份validation。 问题是,我已经意识到,即使我在密码后面放置字符,我也可以与用户一起login。
作为一个例子,让user1的密码被passwd 。 我的意思是我可以使用服务,如果我inputuser1和密码,但我也可以input,如果我inputuser1和passwdwdwd 。 只要第一个字符是我可以input的真实密码,但我之后键入其他字符。
另一方面,如果我在真实密码之前input字符,则无法使用该服务。
我们在SUSE Linux Enterprise Server 11 SP2中安装了OpenLDAP 2.4.26
slapd的configuration是这样的:
include /etc/openldap/schema/core.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/rfc2307bis.schema include /etc/openldap/schema/yast.schema pidfile /var/run/slapd/slapd.pid argsfile /var/run/slapd/slapd.args access to dn.base="" by * read access to dn.base="cn=Subschema" by * read access to attrs=userPassword,userPKCS12 by self write by * auth access to attrs=shadowLastChange by self write by * read access to * by * read loglevel 0 database bdb suffix xxxxxxx rootdn xxxxxxx rootpw xxxxxxx directory /ldap checkpoint 1024 5 cachesize 10000 index objectClass,uidNumber,gidNumber eq index member,mail eq,pres index cn,displayname,uid,sn,givenname sub,eq,pres
任何想法可能是什么问题?
非常感谢你
问候,
我发现了这个问题。 我的密码(和其他用户)是通过使用crypt存储的,根据它的文档 :
通过取密钥的前八个字符中的每一个的最低7位,获得一个56位密钥 。
由于我们的密码长度为8个字符,因此即使我在正确的密码后input更多字符, crypt也会返回相同的散列值。
非常感谢你。
最好的祝福