I use SMS for MFA (yes I know it's bad, but better than no MFA) in an web application.
On login an OTP is sent to the user via SMS.
This OTP is valid until:
- it expires after 10 minutes
- it is submitted successfully (can only be used once)
- it is entered incorrectly more than a 5 times (brute force protection)
So far, so normal. What I do differently than most implementations that I saw, is that if the user requests the OTP again, I send exactly the same OTP again. Most implementations send a new OTP and invalidate the original one.
I do this because of UX considerations, what if the user did for some reason not see the first SMS (or it is delayed because of some reason) and then mixes those two messages up.
My questions is: why do applications generally regenerate the OTP on resend? What are the possible attacks/security problems if I don't do this?