Enabling a user to revert a hacked change in their email

I am writing a web app and I want to set up a system where, when a user changes their email, it gives them a link to have the change revert back. The purpose of this is for when a hacker changes an account email. In this case the user can’t log in without it being reverted. Login is email + password.

I need to handle a hacker doing multiple changes trying to use up a revert list. And I don’t want the ability to revert by just entering an email as that would allow major mischief by hackers. So I came up with the following. Will this work? Is there a better approach?

On an email change, I create a GUID and then save in the DB the GUID, old email, and old password hash. The email sent to them lists the change and says to revert click the link. The link has the GUID in it. Upon receiving that link, it reverts back to the previous email & password hash. If possible (I’m using Blazor server), it will log out any other sessions for this user. Should I then force them to use 2FA? Nightly clean-up will delete any revert records that are over a month old. Will this work? Any security holes?

submitted by /u/HeadClicker52
[link] [comments]

June 3, 2023
Read More >>

Divorce 101

Cathy Dewitt Dunn President and CEO of DeWitt & Dunn Financial Services shares the financial tips for people going through a divorce.

June 3, 2023
Read More >>