When I click "Share" on a question or an answer, if I am logged in, a /{$account_id}
is automatically appended to the link, probably for the Announcer family of badges [citation needed]. However, this account ID can be easily used for resolving the account name and other public details, simply through https://domain.stackexchange.com/users/{$account_id}
.
This may lead to users accidentally leaking their account when they share the links. As far as I understand from a quick google on "StackExchange real name policy" and "StackExchange multiple accounts policies", StackExchange does not have any explicit stances on anonymity or having multiple virtual online identities, but this problem may accidentally make other people know about your StackExchange account as another virtual identity.
As a matter of fact, I only have one SE account, and as you can see, it is obviously anonymous from real life. Just now, I almost included my account name when sending it to a friend who doesn't know about this identity of mine.
Here I am suggesting three possible solutions:
- In account settings, set the preference not to include the account ID, but instead, like a non-logged-in visitor. This may, however, lead to the Announcer-family badges not working.
- Make a separate table (or whatever) in the database that maps numbers to question/answer IDs + user ID, so when a user clicks "share", a random/increment number is generated and mapped to the user's ID and question/answer ID.
- Simply encrypt the user ID with an internal key, then with the question/answer ID, i.e.:
share_link = 'https://domain.stackexchange.com/q/' + question_id + '/' + encrypt( key: question_id, message: encrypt( key: internal_key, message: user_id ) )