Automattic · Report #67660
Verification code issues for Two-Step Authentication
How it was found
Hi there, I noticed two issues regarding the verification code that is sent to the phone as Two-Step Authentication for Wordpress accounts. I found out that verification code sent as SMS while enabling Two-Step Authentication can be reused infinitely for login.
Issue#1 The application does not correctly verifies the verification code for login
Steps to reproduce:
- Log into your Wordpress account
- Navigate to Security under Profile
- Enable Two-Step Authentication
- Select verify via SMS
- Note down the verification code (MagicCode)
- Complete the process by selecting I am finished printing
- Sign out from the application
- Log into the application by providing email/username and password
- When application will prompt you to provide verification code, use the code(MagicCode) initially provided while enabling the 2-FA
- Notice that you are allowed to logged in using obsolete verification code.
- Try it multiple times by logging out and log in by providing same MagicCode all time during 2-FA verification.
It simply kills the purpose of having second factor when you are not verifying it correctly. An attacker can use it for account take over.
Issue#2 The application does not correctly verifies the verification code for disabling Two-Step Authentication
Steps to reproduce:
- Follow steps 1 through 6 from the Issue#1
- After sometime, again navigate to Security and click on Two-Step Authentication
- Click on "Disable Two-Step Authentication"
- It will prompt for verification code that is sent to your mobile phone (note : A code has been sent to your device via SMS. You may request another code after one minute.)
- Instead of typing the new code, use the old code(MagicCode) that was received as the first SMS during enabling 2-FA.
- Notice that you are able to Disable Two-Step by using past verification code
This is a weird behavior of the MagicCode. Its not time based as well. I have tried it after waiting sufficient time. There are other codes as well received during the test like the code for disabling 2-FA but they behave differently.
Currently I am trying to build attack scenario where an attacker can take advantage of this behavior but nevertheless it does not stop you from delving into the matter and fixing the issue.