How improper OTP implementation could lead to Account Take Over (Part 4)

M Maulana Abdullah
3 min readJun 30, 2023

--

https://weekly.infosecwriteups.com/content/images/size/w1200/2022/07/IW-NL-15.jpg

OTP which acts as a second layer of authentication must be applied in all systems that serves same resources in this context for e.g mobile and web application.

This case has been found at a redacted.id which runs online ticketing business for transportation through their website and mobile application. Going through the experience in the android app, there is no fault common finding that discussed in the last three article.

OTP is well exercised after first authentication happen during login and inside API body response for getOTP there is no explicit token mentioned.

Mobile version login authentication prompt OTP verification

But not with the webpage, it has only a single step of login.

Web version login authentication is successful with 200 API body response and doesnt prompt any OTP verification

1. Resetting password through web version for administrator account take over

Let’s observe new password setup process for an authenticated user

Web version new password change is not challenged by the OTP at all. 303 response is given for a password changes at /profile/updatepass API.

According to above picture, a legitimate user is able to update credential with 303 http header response at /profile/updatepass API. What if we attempt to change password for an administrator account which is found on the website information admin@redacted.id.

Administrator account new pasword setup via web version application.

According to same 303 response like the legitimate one, let’s test that out on login API with admin account and adminpassword credential.

2. Login with administrator account

Login using new credential of administrator account is succesful via web version

BOOM !!! It can be seen that administrator account is now being taken over, this is one of the impact applying OTP is partially implemented at this case on mobile version only but not with the web page one.

With this administrator account, booking a ticket is possible without any actual payment which might jeopardize the business.

In summary, improvement point can be taken so far :

  1. OTP must be exercised on all business channels which serves same resources or functionality
  2. Reset password is only applicable and allowable for the authenticated user

In case you might have another input / feedback in terms of improvement point please kindly comment.

--

--

M Maulana Abdullah

IT enthusiast. Written articles are much more about API development vulnerabilities. Let business owner to understand the issue is my priority.