Should Unicode be allowed in usernames?

后端 未结 8 1932
感情败类
感情败类 2020-12-25 09:58

Why do most (all?) websites only support usernames in ASCII? Are there any security considerations if an admin decides to start accepting Unicode usernames?

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-25 10:36

    Homoglyph attacks. User 'cat' and 'сat' are different unicode strings although they look the same. The first letter in the second 'сat' is Russian 'с' - "CYRILLIC SMALL LETTER ES" to be exact. The system can't easily tell that you're spoofing another user's name - to the computer the nicks are different.

    Edit: Preventing mixed scripts does not solve the problem. For example 'сосо' is pure Cyryllic and can be used to spoof ascii 'coco'.

    Also, left-to-right override (and friends.) Leave them unsanitized and they'll mess up your whole page.

提交回复
热议问题