Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

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

Open Gummikavalier opened this issue 9 years ago • 15 comments

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.

Gummikavalier avatar Oct 25 '17 17:10 Gummikavalier

have same issue , version 0.59.2

efih avatar Oct 26 '17 06:10 efih

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.)

Gummikavalier avatar Oct 26 '17 07:10 Gummikavalier

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 avatar Oct 26 '17 10:10 ArchimedesFM

@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.

Gummikavalier avatar Oct 26 '17 10:10 Gummikavalier

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

efih avatar Oct 26 '17 13:10 efih

Also confirmed on 0.59.2

hartois avatar Oct 26 '17 17:10 hartois

same for Polish characters in 0.59.2

zahaim avatar Oct 27 '17 07:10 zahaim

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.

traxanos avatar Oct 27 '17 14:10 traxanos

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

traxanos avatar Oct 27 '17 14:10 traxanos

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.

traxanos avatar Oct 27 '17 14:10 traxanos

Thanks guys, I'll take a look ASAP

rodrigok avatar Oct 27 '17 18:10 rodrigok

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

rodrigok avatar Oct 29 '17 12:10 rodrigok

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

rodrigok avatar Oct 29 '17 12:10 rodrigok

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

Gummikavalier avatar Oct 29 '17 15:10 Gummikavalier

with 0.59.3, works for me now. thanks!

deogracia avatar Nov 02 '17 10:11 deogracia