wiltonsr / ldapAuth

An open source Traefik Middleware that enables authentication via LDAP in a similar way to Traefik Enterprise
https://plugins.traefik.io/plugins/628c9eb7ffc0cd18356a979c/ldap-auth
Apache License 2.0
117 stars 10 forks source link

[Bug] Apostrophe in user DN fails to match allowed groups #50

Closed fcinqmars closed 1 year ago

fcinqmars commented 1 year ago

I have a user that has an apostrophe in their last name causing the LDAP filter for group matching to fail. The reason behind it is that the Go templating uses HTML templates and outputs the resulting filter as:

(|(member=CN=First N'ame,OU=Users,OU=Company,DC=test,DC=local)(uniqueMember=CN=First N'ame,OU=Users,OU=Company,DC=test,DC=local)(memberUid=fname))'

The filter should read: (|(member=CN=First N'ame,OU=Users,OU=Company,DC=test,DC=local)(uniqueMember=CN=First N'ame,OU=Users,OU=Company,DC=test,DC=local)(memberUid=fname))'

As per above, the apostrophe (') is escaped to '.

wiltonsr commented 1 year ago

Fixed by #51