Skip to content
Account takeover Disclosed report Intermediate

Improper Validation at Partners Login

The partner login OTP endpoint did not properly validate the country code field, which was concatenated with the phone number before being passed to the SMS provider. Because the provider accepted multiple numbers separated by spaces, an attacker could have the victim's OTP delivered to their own number as well.

ashoka_rao Follow

Originally disclosed on HackerOne

Bounty$2,000 Critical View original
  • Triaged in 12 hours
  • Fixed in 18 days
  • Paid in 22 hours
  • Disclosed after 12 months

Summary by the program

Timeline

Timeline Action
Thu, 24 Sep 2020, 12:10 IST Researcher submitted the report on H1 with initial severity as High.
Thu, 24 Sep 2020, 12:32 IST First response - we asked for clarification via demonstration on attack scenarios. Parallelly, we began our own investigation.
Thu, 24 Sep 2020, 14:44 IST Researcher provided additional clarification as requested earlier.
Thu, 24 Sep 2020, 21:59 IST Security Team analyzed the scenarios and realized the attack scenarios were not as significant as claimed. We requested additional information to substantiate the scenarios.
Thu, 24 Sep 2020, 23:49 IST Security Team was able to identify the issue independently, based on the preliminary information provided by the researcher.
Thu, 24 Sep 2020, 23:51 IST Researcher shared additional context with new attack scenarios
Thu, 24 Sep 2020, 23:54 IST SSeverity upgraded from High to Critical (9.8 CVSS) by the Security Team, as per the additional attack scenarios shared by the researcher.
Thu, 24 Sep 2020, 23:54 IST Security Team was able to reproduce the issue. Report Triaged.
Thu, 24 Sep 2020, 23:56 IST Security Team started an investigation to observe abuse caused by the vulnerability
Fri, 25 Sep 2020, 00:01 IST Merchant Team proposed solution.
Fri, 25 Sep 2020, 00:10 IST Patch raised for review.
Fri, 25 Sep 2020, 00:18 IST Security Team confirmed the entities used in the demonstration by the researcher.
Fri, 25 Sep 2020, 00:26 IST Researcher confirmed the entitled used in the demonstration.
Fri, 25 Sep 2020, 00:27 IST Fix Deployed on internal systems for testing.
Fri, 25 Sep 2020, 00:30 IST Security Team confirmed vulnerability was not abused and did not impact any customer. More detailed investigation and log analysis of past events were carried out.
Fri, 25 Sep 2020, 00:38 IST Fix verified by Security Team.
Fri, 25 Sep 2020, 00:45 IST Fix merged in the codebase.
Fri, 25 Sep 2020, 09:30 IST Initial investigation confirmed no abuse against the issue reported.
Fri, 25 Sep 2020, 10:00 IST Panel decided and finalized on the bounty.
Fri, 25 Sep 2020, 10:14 IST Bounty awarded.
Fri, 25 Sep 2020, 10:30 IST Fix rolled out.
Fri, 25 Sep 2020, 10:35 IST Merchant team began monitoring changes and continued to search for more issues.
Fri, 25 Sep 2020, 12:14 IST Additional investigation implemented to look for similar issues in our system.
Fri, 25 Sep 2020, 18:35 IST Merchant team confirmed the presence of no abuse due to the highlighted issue in the past events.
Fri, 26 Sep 2020, 21:08 IST Security Team reached out to the researcher to confirm the fix.
Fri, 26 Sep 2020, 21:20 IST Researcher confirmed the fix.
Tue, 29 Sep 2020, 21:20 IST Security Team shared the resolution report status timeline.
Wed, 30 Sep 2020, 15:20 IST All investigations completed, no cases of vulnerability abuse found, and no customer was impacted.
Fri, 02 Oct 2020, 15:20 IST Resolution timeline changed - we decided to keep the report open while the team looks for more similar scenarios in related systems.
Sat, 10 Oct 2020, 15:20 IST Resolution timeline finalized by the panel.
Mon, 12 Oct 2020, 09:30 IST Report marked as resolved.
Mon, 12 Oct 2020, 10:48 IST Researcher requested disclosure of the report.
Mon, 15 Oct 2020, 10:48 IST Report moved to disclosure queue for decision.

Summary

The following request was vulnerable:

HTTP
POST /merchant-api/dining/merchant-login/v1/send-otp HTTP/1.1
Host: www.zomato.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json
x-zomato-csrft: CSRF
x-zomato-app-version: 2
services-access-token:
Content-Length: 79
Origin: https://www.zomato.com
Connection: close
Referer: https://www.zomato.com/partners
Cookie: XXXXXXX

{"res_id":"XXXXXXXX","country_isd":"918888888888,","phone_number":"XXXXXXXXXX"}

There were no strict checks on country_isd. Our backend generated the OTP for phone_number param but appended the country_isd parameter to the phone_number param before sending the SMS without any major checks. Our SMS provider supports multiple phone numbers separated by spaces. After appending the phone number will become: 918888888888,XXXXXXXXXX where 8888888888 is the attacker's number and phone_number is the victim's phone number.

Here the reporter was able to demonstrate an attack to get the OTP of the victim on both the attacker's number and the victim's number.

The original report as published on HackerOne, by ashoka_rao. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 country code parameter was concatenated to the phone number without validation, and the SMS provider interpreted the combined string as multiple recipients.

Impact

An attacker could receive the victim's login OTP on their own phone; the report states no customer was impacted and no abuse was found.

What the attacker needed

Attacker knows victim's phone number; attacker controls a phone number

The fix

The issue was fixed and the fix was deployed, verified and rolled out; the text does not describe the change.

How it was found

  1. Send a request to the partner login send-otp endpoint with a JSON body containing the resource id, a country code value, and the phone number.
  2. Set the country code value so that it contains the attacker's number followed by a separator and then the victim's number.
  3. Observe that the OTP is delivered both to the attacker's number and to the victim's number.

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.

When you log in with a phone number, the site sends a one-time code (OTP) by text message. This endpoint took a separate 'country code' value and simply glued it onto the phone number before handing it to the SMS service. The SMS service allowed several numbers in one request, so an attacker could sneak their own number in and receive the victim's code too.

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.

More by ashoka_rao

View all

2 more disclosed reports, best first.

More from Eternal

View all

The newest disclosed reports for this program.

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.