I'm confused about why they even had the need for canonicalising the usernames for whatever purpose? Why couldn't they just have stored and used them just as they are?
If they did as you suggest, the specific account-stealing flaw they had wouldn't happen, but since many unicode points have very similar glyphs, there would still be "copycat" accounts. That is, the strings "Oscar" and "Οscar" appear very similar (if one has the proper fonts installed), and one user could therefore pose as another. It's true that many sites don't care about this, but I don't fault Spotify for trying…
Creative usernames and Spotify account hijacking
21–30 of 83 posts
Re: Creative usernames and Spotify account hijacking
#22Earlier quoted context omitted.
They gave one reason in the post. They wanted usernames to be case insensitive, so that if there's a user named BigBird, somebody else can't sign up as bigbird. Case insensitive usernames are also helpful to minimize support issues when somebody forgets the exact case they used when they created their account.
Am I insensitive in wondering "Why not just limit it to lowercase, ASCII chars"?
Re: Creative usernames and Spotify account hijacking
#23Re: Creative usernames and Spotify account hijacking
#24Reminds me of the early GMail bug, where you could sign up with "john.smith", "jo.hn.smi.th" or "johnsmith", but all mail was delivered to the period-less version: http://arstechnica.com/uncategorized/2006/01/6022-2/
I've always liked that they do this on my accounts.
Re: Creative usernames and Spotify account hijacking
#25Reminds me of the early GMail bug, where you could sign up with "john.smith", "jo.hn.smi.th" or "johnsmith", but all mail was delivered to the period-less version: http://arstechnica.com/uncategorized/2006/01/6022-2/
> As it turns out, even though Gmail will act as if there is no period in a username when delivering mail, it will not permit users to register accounts whose only difference to other account is a period. That is, if bob.jones is registered, bobjones cannot get an account (he could get bobjones2, obviously).
Re: Creative usernames and Spotify account hijacking
#26Reminds me of the early GMail bug, where you could sign up with "john.smith", "jo.hn.smi.th" or "johnsmith", but all mail was delivered to the period-less version: http://arstechnica.com/uncategorized/2006/01/6022-2/
So, it's not a bug but rather a pretty nice feature: ever seen a handwritten email address with a period squeezed in there?
Re: Creative usernames and Spotify account hijacking
#27Why does Unicode threat Omega and Ohm like different characters?
Because they have rather different meanings. Capital omega (Ω, U+03A9) is a Greek letter, with the lower-case form ω; ohm (Ω, U+2126) is a symbol used in electrical engineering with a related symbol "mho" (℧, U+2127).
Note that omega was probably used so that the 'O' wouldn't be confused with '0', e.g. 4O would be confusing, but 4Ω is not.
[1]The tesla is abbreviated 'T', joule is 'J', etc. etc.
Re: Creative usernames and Spotify account hijacking
#28This seems odd. I mean, if their code was properly modular , they would have just one place where they "fetchUserIdByName(userName)", which returns one user ID or null if it's not used yet. When a new user is created, it then gets assigned a unique user ID. The email address is assigned to that user ID. Then, if they do a password reset on user = "bigbird", it should do the exact same lookup to find the email address…
Easy to implement in a small project. Not so easy in a large enterprise project likely comprised of multiple interconnected systems.
Re: Creative usernames and Spotify account hijacking
#29This seems odd. I mean, if their code was properly modular , they would have just one place where they "fetchUserIdByName(userName)", which returns one user ID or null if it's not used yet. When a new user is created, it then gets assigned a unique user ID. The email address is assigned to that user ID. Then, if they do a password reset on user = "bigbird", it should do the exact same lookup to find the email address…
Based on their description of the bug, it sounded like the code was modular, but they called the function twice: once when the password reset request was generated, and again when the link in the email was clicked. However, when the link was used, canonical_username was once again applied So after they sent the password reset link, they called "fetchUserIdByName" again, but they passed in a username that had already…
Re: Creative usernames and Spotify account hijacking
#30I don't see any real reason to rely on idempotence. They could simply store two names: One is provided by the user (verbatim), and the second is its reduction to lowercase letters and digits (canonical). For all internal logic, they could use only the canonical name, and use the verbatim name in the front-end to make the user happy. > Lower casing has the key property of being idempotent, i.e., that applying it more…
Presumably you mean in the database? I don't see a reason to keep a copy of the lower() transformation of a string when it is incredibly cheap to transform a small string to lowercase.
What exactly is the point of that? I would just call lower() as needed, personally.