Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groupname with parentheses in it crashes FindGroups #91

Open
jurjendijkstra opened this issue Feb 10, 2021 · 3 comments
Open

groupname with parentheses in it crashes FindGroups #91

jurjendijkstra opened this issue Feb 10, 2021 · 3 comments

Comments

@jurjendijkstra
Copy link

jurjendijkstra commented Feb 10, 2021

Our nodejs server crashes when a group has a name like "xxx users (production)"

(node:6344) UnhandledPromiseRejectionWarning: Error: illegal unescaped char: (
at escapeValue (xxx\src\node_modules\ldap-filter\lib\index.js:49:13)
at parseExpr (xxx\src\node_modules\ldap-filter\lib\index.js:167:16)
at parseFilter (xxx\src\node_modules\ldap-filter\lib\index.js:228:14)
at parseFilter (xxx\src\node_modules\ldap-filter\lib\index.js:204:13)
at Object.parse (xxx\src\node_modules\ldap-filter\lib\index.js:252:18)
at Object.parseString (xxx\src\node_modules\ldapjs\lib\filters\index.js:180:27)
at Client.search (xxx\src\node_modules\ldapjs\lib\client\client.js:567:30)
at Searcher.search (xxx\src\node_modules\activedirectory2\lib\components\search.js:118:15)
at search (xxx\src\node_modules\activedirectory2\lib\components\search.js:352:19)
at GroupsFinder.find (xxx\src\node_modules\activedirectory2\lib\components\findGroups.js:113:3)
at findGroups (xxx\src\node_modules\activedirectory2\lib\components\findGroups.js:168:23)
at PromisedAD.findGroup (xxx\src\node_modules\activedirectory2\lib\activedirectory.js:798:3)

to do:

  1. handle the promise rejection when it happens. That may be a responsibility of my application, or maybe somewhere inside activedirectory2, don't know yet
  2. escape the groupname when we write the ldap query, similar to how we escape usernames in the ldap query.

I want to try and submit a pull request, but I am a bit swamped in work currently, so it may take me a while

@indefinitelee
Copy link

@jurjendijkstra I'm also facing this bug. Do you have any suggestions on debugging it? I've been trying to step through the code but am not having much luck determining where the problem is.

@jsumners
Copy link
Owner

jsumners commented Oct 29, 2021

https://github.com/pfmooney/node-ldap-filter/blob/daa5a5d5d11c73582275cc75aa9f3ff839b1ab06/CHANGES.md#030

@thiago-glauco
Copy link

Could I start contributing to this project with this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants