Skip to content
Account takeover Write-up Intermediate

From Demo to Live: Zero-Click Account Takeover via the Same Encryption Algorithm

The demo environment accepted a fixed OTP value and issued access tokens whose value depended only on the sequential user ID, so the same token worked in the live environment. An attacker could create accounts in the demo and reuse the resulting tokens to take over live accounts, including other users' personal, payment and subscription data.

infosecwriteups.com

Published on infosecwriteups.com

An encryption algorithm that passes security tests and seems flawless… But once it goes live, imagine accounts being taken over without a single click. So, how did I make this possible?

can1337, on infosecwriteups.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 access token was derived deterministically from the sequential user ID with a shared secret used in both demo and live environments, and the demo accepted a fixed OTP, so tokens minted in the demo were valid in production.

Impact

An attacker could take over live accounts one by one, starting from a known ID, and access personal information, phone numbers, addresses, identification data, payment details and subscription details.

What the attacker needed

Access to the demo environment; a phone number for demo registration; knowledge of a target user ID

The fix

The issue was fixed; the text does not describe the change, but tokens should not be derived from predictable IDs and demo and live environments should not share token secrets.

How it was found

  1. Test the demo environment and notice that pre-registration OTP requests always return the value 1234.
  2. Register in the demo with a random phone number and the fixed OTP, then inspect the HTTP response containing the access token.
  3. Take the token from the demo response and send the same request to the live environment.
  4. Observe that the live application accepts the token and logs the attacker into the account matching the same user ID.
  5. Create further demo accounts to walk through sequential IDs and take over the corresponding live accounts.

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 demo or test copy of a site is meant to be separate from the real one. Here the two copies used the same secret recipe to build login tokens, and that recipe only used the user's number in the database. Because the demo let anyone log in with a fixed code, an attacker could get a token for any number and then use it on the real site to become that user.

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.