fix: Handle integrity violations when confirming email address - #5506
Conversation
| None, "Email address is in use by another user. Please contact the secretariat for assistance." | ||
| ) |
There was a problem hiding this comment.
Wouldn't this again leak the existence of email addresses?
There was a problem hiding this comment.
Only if you can receive messages sent to that address - this code runs in response to following the confirmation link that was just emailed there.
Further, the duplicate confirmation link will only be generated if you attempt to add the address between the times its rightful owner adds it and confirms it.
My thought was that if you can engineer your way through that you probably already know the address is there. I think this is more likely to come up for someone having account issues so it is better to nudge them to get help. I could make it treat this like an invalid link, though, and that would leak the least possible information.
There was a problem hiding this comment.
You could also get to this code by brute force posts, but it would require creating a valid signature over the username and email, and that essentially requires knowing the site's secret key. If that's compromised, there are worse problems.
| None, "Email address is in use by another user. Please contact the secretariat for assistance." | ||
| ) |
There was a problem hiding this comment.
You could also get to this code by brute force posts, but it would require creating a valid signature over the username and email, and that essentially requires knowing the site's secret key. If that's compromised, there are worse problems.
This avoids server errors when an email confirmation link is used more than once or when the confirmed email address is in use for another User.
The latter case is mostly prevented by the user edit views, but can come up if there are concurrent attempts to add the same address to two different Users.