LDAP failing after latest update
Hello @nuxsmin ,
I hope you are doing well.
I'm having a LDAP issue after updating to the latest version of sysPass (2.1.16.18061901). Previously, I was 2 versions behind an everything was working fine. The issue surfaced with users updating their AD password, but when logging in to sysPass, they could only use their old password. Before the update, after AD password reset, users used their new password, and sysPass asked for the old one, and everything worked fine.
The error I'm getting in the log is:
Error while searching the user on LDAP
User : johnd
LDAP ERROR : Success (0)
LDAP FILTER :
(&(|(samaccountname=6a\6f\68\6e\64)(cn=6a\6f\68\6e\64)(uid=6a\6f\68\6e\64))(!(UserAccountControl:1.2.840.113556
.1.4.804:=34))(|(objectClass=inetOrgPerson)(objectClass=person)(objectClass=simpleSecurityObject))(objectCategory=person))
I'm not sure why the results are retrieved in Hexadecimal.
If I go to LDAP settings and run a check, everything seems to be working fine and I can see sysPass retrieve the results successfully.
We haven't changed anything in the domain controllers setup. There were some Windows updates though.
I have also noticed that I can't change the 'Login Attribute" in LDAP settings page. (I change it from sAMAccountName to userPrincipalName, click save, it says saved successfully, refresh the page, sAMAccountName is still there).
Your help is much appreciated.
I have been testing the filter that is failing as shown in the logs, it seems when I add this part
(!(UserAccountControl:1.2.840.113556.1.4.804:=34))
the filter doesn't return any results. I f I remove, it returns the user details successfully.
Hello @VexedSyd
I hope you're doing well too.
There were some LDAP updates in latest commits and it seems that UserAccountControl:1.2.840.113556
.1.4.804:=34 filter has introduced some odd behaviour when retrieving LDAP results. This filter was added by a contributor to filter out disabled accounts and do not require a password, and it should work on ADS environments (https://support.microsoft.com/en-us/help/305144/how-to-use-the-useraccountcontrol-flags-to-manipulate-user-account-pro).
Could you set it to ``UserAccountControl:1.2.840.113556 .1.4.804:=32` ?
Thanks for the feedback!
Kind Regards
Hi @nuxsmin ,
Thanks for your prompt reply. I have tried UserAccountControl:1.2.840.113556.1.4.804:=32 that didn't work. I'm just wondering, could it be that we have to pass the filter value in Hex as well? since every value in that filter is in Hex. I tried 22 and that worked.
Is there a way we can remove UserAccountControl from filter?
Many thanks.
I don't think passing UserAccountControl in Hex will solve the problem.
I don't think passing UserAccountControl in Hex will solve the problem.
Right, Hex values should be used to encode special chars in filter strings, but you can set plain text/numeric values on any filter.
It seems that UserAccountControl change should be regressed.
It seems that UserAccountControl change should be regressed.
It would be great if you can regress that. Many thanks for your great support.
I have removed (!(UserAccountControl:1.2.840.113556.1.4.804:=34)) from the filter in LdapMsAds.class.php and everything is working fine in our environment now. Many thanks for your help.
fixed with #1050