Skip to content
Account takeover Disclosed report Beginner

Verification code issues for Two-Step Authentication

The two-step authentication verification code sent by SMS could be reused indefinitely for login and for disabling two-step authentication. An attacker who obtained the code could bypass the second factor and take over the account.

maverickrocky02 Follow

Originally disclosed on HackerOne

  • Triaged in 45 days
  • Fixed in 2 months
  • Paid in 2 months
  • Disclosed after 3 months

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:

  1. Log into your Wordpress account
  2. Navigate to Security under Profile
  3. Enable Two-Step Authentication
  4. Select verify via SMS
  5. Note down the verification code (MagicCode)
  6. Complete the process by selecting I am finished printing
  7. Sign out from the application
  8. Log into the application by providing email/username and password
  9. When application will prompt you to provide verification code, use the code(MagicCode) initially provided while enabling the 2-FA
  10. Notice that you are allowed to logged in using obsolete verification code.
  11. 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:

  1. Follow steps 1 through 6 from the Issue#1
  2. After sometime, again navigate to Security and click on Two-Step Authentication
  3. Click on "Disable Two-Step Authentication"
  4. 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.)
  5. Instead of typing the new code, use the old code(MagicCode) that was received as the first SMS during enabling 2-FA.
  6. 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.

The original report as published on HackerOne, by maverickrocky02. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application did not invalidate or time-limit the SMS verification code after it was first used, so the same value remained valid for later login and disable requests.

Impact

An attacker who obtained the initial SMS code could log in repeatedly and disable two-step authentication, leading to account takeover.

What the attacker needed

A WordPress account; SMS two-step authentication enabled; knowledge of the initial SMS code

The fix

The report asks for the issue to be fixed; it does not specify how.

How it was found

  1. Log in and enable two-step authentication via SMS.
  2. Note the verification code received during setup.
  3. Sign out and log in with username and password.
  4. Enter the old setup code at the verification prompt and observe successful login.
  5. Repeat login with the same old code multiple times.
  6. Later, open two-step settings, choose disable, and enter the old setup code instead of the new one.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Two-step authentication adds a second check, usually a code sent to your phone, so a stolen password alone is not enough. Here the same code kept working forever instead of expiring after one use, so anyone who saw it once could log in or turn the protection off.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More from Automattic

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.