Skip to content
Account takeover Write-up Intermediate

OTP Bypass via Client-Side Encryption Flaw

The OTP verification workflow relied on client-side encryption with exposed keys in a JavaScript file, allowing an attacker to tamper with the encrypted OTP response. This enabled account registration using an incorrect OTP.

medium.com

Published on medium.com

A critical flaw in the OTP verification workflow of a customer registration portal allowed account creation without a valid One-Time Password. The root cause was client-side cryptographic handling and exposed keys, enabling manipulation of the OTP verification process.

eSecForte Technologies, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the server trusted a client-encrypted OTP value without independently verifying the OTP against the expected value, and the encryption keys were exposed client-side.

Impact

An attacker could create accounts without a valid OTP, bypassing phone verification.

What the attacker needed

Access to the registration portal; ability to intercept HTTP traffic; a mobile number

The fix

OTP verification should be enforced server-side, with the client only handling display and input, and cryptographic keys should not be exposed client-side.

How it was found

  1. Access the registration page and enter a mobile number.
  2. Submit an incorrect OTP and observe the failure.
  3. Intercept the OTP verification request using Burp Suite and send it to Repeater.
  4. Capture a separate request with a different mobile number and a valid OTP to compare responses.
  5. Review source files and find crypto.js containing encryption logic and keys.
  6. Recreate the encryption externally, alter the encrypted OTP value, and submit a wrong but properly encrypted OTP.

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 write-up has not been written yet. The Original tab links to the source.

A one-time password (OTP) is a code sent to your phone to prove it's you. Here, the app checked the code using logic that ran in the user's browser, and the secret keys were visible to anyone. So an attacker could change the code and still create an account.

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.

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.