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

[Bug]: It's possible to change display name to blank using invisible unicode characters. #3436

Closed
4 tasks done
Josephos opened this issue Jul 1, 2023 · 0 comments · Fixed by #3437
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@Josephos
Copy link
Contributor

Josephos commented Jul 1, 2023

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

It's possible to change display name to blank using invisible unicode characters. Tested with following:
U+180E
U+2060
U+3164
U+2800
U+2060
U+FFEF

As evidenced by the error message when trying to naively set name to usual whitespace characters, this behaviour is undesirable (And could be abused.)

Result:
image

Steps to Reproduce

  1. Open setting, change your name to 3 spaces.
  2. Observe error about invalid username.
  3. Change your name to any of the above characters.
  4. Observe successful name change.

Technical Details

Tested on Windows 10, Firefox 114.0.2, on following instances:
https://lemmy.world/
https://lemmy.ml/
https://iusearchlinux.fiy/

Version

BE 0.17.4, BE 0.18

Lemmy Instance URL

https://lemmy.world/, https://lemmy.ml/,https://iusearchlinux.fiy/

@Josephos Josephos added the bug Something isn't working label Jul 1, 2023
Nutomic pushed a commit that referenced this issue Jul 4, 2023
* Fixed validation of display names

Fixed validation of display names: reject names beginning with invisible unicode characters.

* Formatting

Formatting fix.

* Expanded list of forbidden Unicode characters. Validation now checks for disallowed characters anywhere in the name.

* Formatting

* Added a comment detailing source of the list of invisible chars.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant