Username protection
Your Rocket.Chat version: (43.0)
Just to show you how easy it is to fake someone. I changed my username on github to engeIgabrieI.
And on https://demo.rocket.chat I created an account with the username engeIgabrieI too.
There should be some username protection implemented to prevent this from happening.
I implemented some kind of username protection for our member system with java and pearl, but unfortunately I am new with meteor, javascript, coffeescript and mongodb.
But I can offer an idea on how to implement this. if someone is interested.
engeIgabrieI engelgabriel
are actually
engeIgabrieI
engelgabriel
@net-activities so what does your proposed fix do? what's your algorithm for defining valid usernames?
@marceloschmidt the proposed fix prevents users from registering and using usernames which look just as the username of another user. Which is used from trolls to disrupt the community.
For example: Right now you can register a username that looks like yours by using a big i in the username instead of the small L in your username.
One way to implement this could be to calculate a basename for every username and put it into an extra field in the usertable.
And on every new registration and/or using of an username you convert this username into a basename with the same algorithm and check against the basename in the usertable too.
To give you an example: We remove every .-_ in the username, then we replace every l with i, every vv with w, every 0 with o, aso. The result will be the basename, in engelgabriels case this would result in: engeigabriei. This basename goes in the basename field in the usertable.
If someone tries to register engeIgabrieI (both big i instead of small L) or engelgabrieI (only second small L replaced with big i) or engeIgabriel (only first small L replaced with big i) the calculated basename would be engeigabriei every time. So you check the username against the username field AND the calculated basename against the basename field.
And if its already there you deny the usage and/or registration of this username.
I am not quite sure if it's really a good idea to get started with that, as it's pretty likely to become a game of cat-and-mouse.
This also includes some aspects like
- what font is used on an RC instance (with serif fonts, for example, it's less likely to look the same)
- unicode control characters and how to handle them (for example a unicode-mirrored
dmight also be ab- dunno if that's actually possible, but for the sake of the greate argument, let's assume it is)
Any thoughts on that?
From an algorithm point-of-view: I'd do it exactly the way you described.
Cheers Thomas
We now use the system font and the "similar character" problem should no longer be an issue.
We do no have a solution for the general problem. Closing for now,.