Skip to content

fix: Handle integrity violations when confirming email address - #5506

Merged
rjsparks merged 2 commits into
ietf-tools:mainfrom
painless-security:jennifer/email-confirm-errors
Apr 23, 2023
Merged

fix: Handle integrity violations when confirming email address#5506
rjsparks merged 2 commits into
ietf-tools:mainfrom
painless-security:jennifer/email-confirm-errors

Conversation

@jennifer-richards

Copy link
Copy Markdown
Member

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.

Comment thread ietf/ietfauth/views.py
Comment on lines +455 to +456
None, "Email address is in use by another user. Please contact the secretariat for assistance."
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this again leak the existence of email addresses?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ietf/ietfauth/views.py
Comment on lines +455 to +456
None, "Email address is in use by another user. Please contact the secretariat for assistance."
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rjsparks
rjsparks merged commit c6fbdef into ietf-tools:main Apr 23, 2023
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 27, 2023
@jennifer-richards
jennifer-richards deleted the jennifer/email-confirm-errors branch May 1, 2023 21:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants