question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

illegal unescaped char

See original GitHub issue

Hi,

I think that we have a problem with the password, that contains characters like: &%$!() etc.

/opt/pct/node_modules/ldap-filter/lib/index.js:49
      throw new Error('illegal unescaped char: ' + c);
      ^
Error: illegal unescaped char: (
    at escapeValue (/opt/pct/node_modules/ldap-filter/lib/index.js:49:13)
    at parseExpr (/opt/pct/node_modules/ldap-filter/lib/index.js:167:16)
    at parseFilter (/opt/pct/node_modules/ldap-filter/lib/index.js:228:14)
    at Object.parse (/opt/pct/node_modules/ldap-filter/lib/index.js:252:18)
    at Object.parseString (/opt/pct/node_modules/ldapjs/lib/filters/index.js:180:27)
    at Client.search (/opt/pct/node_modules/ldapjs/lib/client/client.js:567:30)
    at ActiveDirectory.search (/opt/pct/node_modules/activedirectory/lib/activedirectory.js:529:10)
    at ActiveDirectory.getGroupMembershipForDN (/opt/pct/node_modules/activedirectory/lib/activedirectory.js:740:10)
    at /opt/pct/node_modules/activedirectory/lib/activedirectory.js:1113:29
    at /opt/pct/node_modules/activedirectory/lib/activedirectory.js:885:5

I just downgraded to version 1.0.2 to fix it, but it could be great if the next release has as well som parser to deal with this typical characters used in strong passwords.

Thanks in advance Antonio

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
jongrubbcommented, Aug 18, 2020

I ran into this error too using activedirectory package. This package has a direct dependency for ldapjs with versioning like"ldapjs": ">= 0.7.1". Which is essentially set to pull the latest version of ldapjs. So, if you do a fresh install of activedirectory, you might encounter this error. This problem is solely due to how activedirectory is using their dependency versioning. So this error was introduced into activedirectory package when ldapjs updated it’s breaking changes from 1.0.2 to 2.0.0. So this isn’t ldapjs’s fault, it’s the fault with the dependency versioning of ldapjs used in activedirectory.

My company is using activedirectory right now. This is not an ideal fix, but a quick one if you are trying to get things deployed. Ideal fix would be switching to a more reliable library with correct dependencies.

If you are still using activedirectory package as a dependency for your project and encountered this error, a quick fix is to force a specific version for ldapjs on activedirectory. We are using yarn. You can specifically tell yarn what version of a transient dependency to use for a specific package. Below is how I fixed this issue for activedirectory package for the time being by adding this to your package.json.

  "resolutions": {
    "activedirectory/ldapjs": "1.0.2"
  },
2reactions
delfuegocommented, Jul 24, 2020

@jsumners Well HOLY CRAP, how did I not know that activedirectory2 exists?!? This certainly looks promising:

https://github.com/jsumners/node-activedirectory/blob/925c35194c04a5583cb0b46653bff88e518de37c/lib/components/utilities.js#L280

I’ll give it a try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Password contains an illegal unescaped character
I have used very simple password, but it still shows same error. How can I fix it? I'm temporarily using 01234567890 as my...
Read more >
IT36886: PARENTHESIS IN USER DN CAUSES ... - IBM
The integration node may also crash with the following error in stderr file Error: illegal unescaped char: ( at escapeValue (C:\Program ...
Read more >
SyntaxError: illegal character - JavaScript - MDN Web Docs
The JavaScript exception "illegal character" occurs when there is an invalid or unexpected token that doesn't belong at this position in the ...
Read more >
Password contains unescaped characters - Drivers & ODMs
MongoParseError: Password contains unescaped characters at new ConnectionString ... Password contains unescaped characters.
Read more >
HL7: Illegal embedded chars - iNTERFACEWARE Help Center
The channel is simple enough, it just uses the hl7.fix{} function to fix (escape) the unescaped “&” characters. There are are two trace()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found