diff --git a/apps/meteor/ee/server/lib/ldap/Manager.ts b/apps/meteor/ee/server/lib/ldap/Manager.ts index a4fe52b781ce..f5fda50c76c5 100644 --- a/apps/meteor/ee/server/lib/ldap/Manager.ts +++ b/apps/meteor/ee/server/lib/ldap/Manager.ts @@ -152,7 +152,7 @@ export class LDAPEEManager extends LDAPManager { filter: filter .replace(/#{username}/g, username) .replace(/#{groupName}/g, groupName) - .replace(/#{userdn}/g, dn), + .replace(/#{userdn}/g, dn.replace(/\\/g, '\\5c')), scope: 'sub', }; @@ -402,7 +402,7 @@ export class LDAPEEManager extends LDAPManager { } const searchOptions = { - filter: query.replace(/#{username}/g, username).replace(/#{userdn}/g, dn), + filter: query.replace(/#{username}/g, username).replace(/#{userdn}/g, dn.replace(/\\/g, '\\5c')), scope: ldap.options.userSearchScope || 'sub', sizeLimit: ldap.options.searchSizeLimit, };