Skip to content
Access control Write-up Intermediate

[BugWithoutBounty] Missing Authentication in TheCoffeeHouse Api

The Coffee House app's API accepted a forged HTTP status code to bypass OTP verification, letting an attacker register accounts with arbitrary phone numbers without authentication. Separately, a reward-history endpoint returned any user's data by changing a numeric identifier, with no authentication required.

medium.com

Published on medium.com

When user input there phone number to login and click next. The OTP will be sent to this phone number and app call screen input OTP.

Le Thanh Phuc (Yang), 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 client-side flow relied on the HTTP status code returned by the server, and the account-creation and reward-history endpoints did not enforce authentication or ownership checks server-side.

Impact

An attacker could create accounts for arbitrary phone numbers without OTP verification and read other users' reward history, though the author notes the vendor may have considered it not serious.

What the attacker needed

Bypass SSL pinning; intercept and modify responses

The fix

The API should enforce OTP verification and authentication server-side and check that the caller owns the requested crm_id, rather than trusting client-side status codes.

How it was found

  1. Enter a phone number that is not registered and submit a wrong OTP.
  2. Intercept the 404 response and change the status code to 200 with a success body.
  3. The app then shows the new-user registration form.
  4. Submit the registration request, which is sent without any OTP code.
  5. Call the reward-history endpoint with another user's crm_id to read their data.

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.

When you log in with a phone number, the app sends a one-time code (OTP) by SMS to prove the number is yours. Here the app trusted a status code that the client could simply rewrite, so the phone check could be skipped. The same API also let anyone read another person's reward history just by changing a number in the request.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.