Bypassing OTP verification

Amolo Hunters
System Weakness
Published in
3 min readJun 15, 2022

--

Author: MrEmpy (https://mrempy.medium.com/)

Introduction

We know that security is the main method of defense against hacker attacks. Some of these safeguards have not been prevailed, which leads to false security and user credibility regarding the security of their account. One-time password (OTP) is one of the ways to protect your account, but like other security methods, it may contain some vulnerability.

What is OTP?

One-time password, or commonly called OTP, is an automatically generated 6-digit code that authenticates a user to their account. The OTP acts as a second and more secure password, especially if the user’s password is weak or reused.

Bypassing OTP verification

One of the ways to bypass OTP verification is by handling the response of a request. What you need to do is enter your credentials and put in a fake OTP code and capture the request. Then intercept the response and change the status code to 200, or some boolean from false to true. Look at the example:

Let’s say an attacker has managed to obtain a target’s credentials and is about to log into the account.

After the login request, the attacker is faced with two-factor authentication. The attacker adds fake code and captures the request.

The request was captured, now the attacker will capture the response.

The status code was 401, barring the fake user code. The attacker can change the status code from 401 to 200 in order to make the application accept the incorrect code.

After the change, it sends the response.

The server magically allows login to the account without having to use any OTP code, breaking the security of the system.

Conclusion

We have learned that even what claims to be its security cannot be secure. There are numerous vulnerabilities around the world, we always need to validate the security of applications to prevent attacks from malicious people. Simple response manipulation allowed the attacker to break into a target’s account, so it’s important to maintain security.

Read more from MrEmpy

--

--