Rocket.chat: LDAP sync breaks non ASCII UTF-8 characters in user names after authentication [0.59.2]

Created on 25 Oct 2017  路  15Comments  路  Source: RocketChat/Rocket.Chat

Description:

LDAP sync breaks Nordic characters in user's full name after authentication in 0.59.2.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.59.2
  • Operating System: CentOS 7
  • Deployment Method(snap/docker/tar/etc): tar
  • Number of Running Instances: 5
  • DB Replicaset Oplog: Enabled
  • Node Version: 4.8.4

Steps to Reproduce:

  1. In admin console Enable Layout -> User Interface -> Use Real Name
  2. Upgrade from RC 0.59.1 to 0.59.2
  3. Log out existing session with a user whose name has non ASCII UTF-8 character.
  4. Log back in and observe user name list in admin console. Also type a message as the user.

Expected behavior:

User's name should be ok and contain UTF-8 characters such as 盲.

Actual behavior:

User's name has changed both in Admin user list and any new messages to contain wrongly decoded characters such 脙陇 (which should be 盲).

The issue did not exist in 0.59.1 or earlier.

Most helpful comment

Guys, version 0.59.3 is building and will be available soon with this fix.

All 15 comments

have same issue , version 0.59.2

I'll also add that since fullname is used in direct room topic bar (if you have Use Real Name option enabled), ASCII formed full names "leak" from there to the channel list. This happens even if one downgrades back to 0.59.1 and updates users via LDAP, then logs back in, or manually fixes the name in the user list.

I could not find malformed names in the database (didn't know where to look originally), so I had to delete all direct rooms using GUI. (After I had found delete button workaround in #8562 comments.)

We have the same issue with newly imported users username und name - Version 0.59.2
I can edit them manually and they dont break again after LDAP-Sync, but maybe after login but i can't test this.

@ArchimedesFM For us it happened only after doing actual login. Running LDAP sync from the setting didn't trigger it, nor did it fix it afterwards.

Edit: Sorry, I did bad reading. I didn't test fixing the user names manually after login. That might help as a band aid for now.

i fix manually also, but after logout&login its happened again

Also confirmed on 0.59.2

same for Polish characters in 0.59.2

The LDAP Plugin totally broken.

  • During the sync LDAP fields are wrong escaped.
  • The manual sync doesn't work correctly - it will only sync new user because the function importNewUsers will be called only.
  • The automatic sync will not work, too. It doesn't start the cron like the description.

Only the sync during the login by user will work, but with broken escaping.

So the first patch ist for fixing manual sync:
https://gist.github.com/traxanos/ed7a0ce104fd0afa170f20d509d4d459

The other problem why special chars are broken is the handling with ldap fields as BINARY!!!
What the hell why the use the field as binary!

https://github.com/RocketChat/Rocket.Chat/commit/e2b0379dc967f59148c8e4b8aeaf4b9a0f914e80

When you revert this the encoding is working again.

Thanks guys, I'll take a look ASAP

Guys, version 0.59.3 is building and will be available soon with this fix.

Please let me know if there are more issues related to LDAP

Seems to work ok for us with 0.59.3. Thanks! :)

with 0.59.3, works for me now. thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

royalaid picture royalaid  路  3Comments

neha1deshmukh picture neha1deshmukh  路  3Comments

antn89 picture antn89  路  3Comments

danpospisil picture danpospisil  路  3Comments

sta-szek picture sta-szek  路  3Comments