Skip to content
Account takeover Disclosed report Intermediate

Authorization bypass using login by phone option+horizontal escalation possible on Grab Android App

The SMS code resend endpoint for the Grab Android app had no rate limiting, while the code activation endpoint allowed only three attempts per code. By repeatedly resetting the code every 30 seconds and trying a small fixed set of four-digit codes, an attacker could eventually guess a valid code and take over any account using only a phone number.

sp1d3rs Follow

Originally disclosed on HackerOne

High 7.5 View original
  • Triaged in under an hour
  • Fixed in 15 days
  • Paid in 20 days
  • Disclosed after 7 months

Summary by the researcher

###Summary I found a OTP code bypass on the login endpoint, used by Grab Android App. Since no password was required upon login (only SMS code), it was actually account takeover (still, the victim will be informed that something is wrong because of few incoming SMSes with codes). The team was very responsible and fixed the issue fast. Thanks to the Grab team for the great experience and the bounty! It is a pleasure to work with you!

###Technique The used method (thanks to the @yaworsk and his #149598 report!) is highly depending on the luck due to low enough chance to guess correct code using only 3 attempts in 30 seconds (and we must consider that the server may not throw the one of the choosen codes for a very long time). So account takeover is not so easy, and requires a lot of time. The side effect of this - it is abusing the SMS sending mechanism (it was fixed too).

###Why it works

  1. The code had only 4 digits (with 5-6 digits chance to guess the code dramatically drop). Even with 4 digits tool can work a week without results.

and 2) There was no limiting on the code refreshing attempts (now it is, and also account can be locked).

###Used tools and apps:

  1. Nox App Player (android emulator), proxied through web debugging proxy.
  2. Tested application - https://play.google.com/store/apps/details?id=com.grabtaxi.passenger (app allows registration from any country)
  3. Custom C# tool for SMS code refreshing.

The report

Description: After my previous report about 2FA bypass on the Profile Edit endpoint i was interested to find enpoint, which will allow me horizontal privileges escalation. So, I found the endpoint using android app https://p.grabtaxi.com/api/passenger/v2/profiles/activationsms which allow me to bypass OTP code due to lack of rate limiting. The root cause of the problem it that facts: resend code endpoint do not have rate limiting (it has only 30 seconds timing for resending possibility). But code activation on the https://p.grabtaxi.com/api/passenger/v2/profiles/activate has 3 attempts limit, then it will be expired. Combined this two facts, i found that it is possible to succeed in the account takeover of any user using only phone number. Method: we have only 3 code attempts, and we can reset the code every 30 seconds without rate limiting. This gave us 6 attempts in the minute, 360 attempts in the hour, and 8640 attempts in 24 hour. Since codes range has only 9999 values (it is 4-digit), we will likely succeed with the correct code in the 24-72 hours. Attacker just need to choose some 3 custom OTP codes, for example, 1056, 1057, 1058, and start trying to send them every 30 seconds. If all 3 codes will fail - reset it and try again in next 30 seconds. Sooner or later, Grab Server will throw some of this codes, and this code will be accepted, and we will have access to the victim's account. How it looks in the Web Debugger - you can see on the screenshot attached (test.png). Example report, where used similar method: https://hackerone.com/reports/149598

##Impact

The attacker can bypass OTP verification on Grab android app on any mobile number using "Login with mobile number" option. Attacker can succeed in the account takeover of any user without any privileges, using only phone number and country code.

##Steps To Reproduce:

  1. Use my POC tool, attached to the report (written on C#, requires .NET 4.0). Sources included.
  2. Enter your test phone number to the field (it must starts with country code without + and be the connected to the Grab account on Android app) - or you can use my test number ███ and press Start.
  3. Tool will start sending 3 code attempts 1056, 1057, 1058 and refreshing the code in case of failing every 30 seconds. The process may take many hours, but sooner or later you will receive message with success response and session header.

##Mitigation/Remediation Steps: I suggest you implement a rate-limiting on this endpoint https://p.grabtaxi.com/api/passenger/v2/profiles/activationsms, for example, blocking code resending for some time after 5 or more resends.

Attachments

test.PNG
test.PNG From the original on HackerOne
prog.PNG
prog.PNG

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

The target is the Grab Android passenger app, distributed through Google Play as com.grabtaxi.passenger. Grab accounts can be created and used from any country, and the app supports a "Login with mobile number" flow in which the only credential requested at login is an SMS one-time code. No password is involved in that flow.

The report concerns two endpoints on the passenger API host p.grabtaxi.com:

  • https://p.grabtaxi.com/api/passenger/v2/profiles/activationsms, which triggers (re)sending of the SMS activation code.
  • https://p.grabtaxi.com/api/passenger/v2/profiles/activate, which submits a code for verification.

Normally the first endpoint lets a user request a fresh code, and the second checks the code the user received. The researcher had previously reported a 2FA bypass on the Profile Edit endpoint, and was interested in finding an endpoint that would allow horizontal privilege escalation.

Setup

The researcher used the following:

  1. Nox App Player, an Android emulator, with its traffic proxied through a web debugging proxy.
  2. The Grab passenger app from Google Play, which allows registration from any country.
  3. A custom C# tool for refreshing SMS codes, written by the researcher, requiring .NET 4.0, with sources attached to the report.

The only input the attack needs is a phone number, including its country code, that is connected to a Grab account. The researcher's own test number is redacted in the report as ███.

Finding it

Two properties of the code flow stood out:

  1. The activation code had only 4 digits. The researcher notes that with 5 or 6 digits the chance of guessing drops dramatically, and that even with 4 digits the tool can run for a week without a result.
  2. There was no limit on how often the code could be refreshed. The resend endpoint enforced only a 30 second timing window between resends, with no rate limiting on the number of resends.

Meanwhile, the activation endpoint did have a limit: 3 attempts, after which the code expires. The combination is the problem. Because a fresh code can be requested every 30 seconds without any cap on the number of requests, the 3-attempt limit can be reset indefinitely.

The researcher credits the technique to @yaworsk and the earlier report #149598, and links that report as an example of a similar method. The technique depends heavily on luck, because the chance of guessing the correct code within 3 attempts in 30 seconds is low, and the server may not issue one of the chosen codes for a very long time. Account takeover is therefore not easy and requires a lot of time. A side effect is abuse of the SMS sending mechanism, which the researcher says was also fixed.

Exploitation

The arithmetic in the report is as follows: 3 attempts per 30 seconds gives 6 attempts per minute, 360 attempts per hour, and 8640 attempts in 24 hours. Since the code space has only 9999 values (4 digits), the researcher expected to hit the correct code within 24 to 72 hours.

Step 1: Choose a small set of fixed codes

The attacker picks a few custom OTP codes, for example 1056, 1057 and 1058, and submits those same values on every round rather than random ones.

Step 2: Submit the three attempts

Each round sends the three chosen codes to the activation endpoint:

HTTP
https://p.grabtaxi.com/api/passenger/v2/profiles/activate

If any of the three is the code the server currently has outstanding, it is accepted. If all three fail, the code is considered expired after the 3-attempt limit.

Step 3: Refresh the code and repeat

After a failed round, the tool calls the resend endpoint to obtain a new code:

HTTP
https://p.grabtaxi.com/api/passenger/v2/profiles/activationsms

The only restriction here is the 30 second wait between resends. Once that window passes, the tool sends the same three codes again. The researcher describes the loop as: try the three codes, and if all fail, reset and try again in the next 30 seconds. Sooner or later the Grab server issues one of the chosen codes, that code is accepted, and the attacker gains access to the victim's account.

test.PNG
test.PNG From the original on HackerOne

The screenshot test.png shows how the attack looks in the web debugger.

Step 4: Run the proof-of-concept tool

The reproduction steps in the report are:

  1. Use the POC tool attached to the report (C#, requires .NET 4.0, sources included).
  2. Enter the test phone number in the field. It must start with the country code without + and must be connected to the Grab account on the Android app. Alternatively, use the researcher's test number ███ and press Start.
  3. The tool sends the three code attempts 1056, 1057, 1058 and refreshes the code every 30 seconds when they fail. The process may take many hours, but eventually a success response and a session header are returned.
prog.PNG
prog.PNG From the original on HackerOne

Root cause

The design flaw is the mismatch between two limits. The activation endpoint limits verification to 3 attempts per code, which on its own would make guessing impractical. The resend endpoint has no rate limiting at all; it only enforces a 30 second delay between resends. Because a new code can be requested every 30 seconds indefinitely, the 3-attempt budget is effectively unlimited over time, and the 4-digit code space (9999 values) becomes reachable. The 3-attempt limit applies to one code, and a new code can be requested every 30 seconds.

Impact

An attacker can bypass OTP verification in the Grab Android app for any mobile number using the "Login with mobile number" option, and can take over any user's account without any privileges, using only the phone number and country code. Because no password is required at login, a successful guess is full account takeover. The victim is not silent: they will receive a few incoming SMS messages with codes, so they will be informed that something is wrong. The attack also abuses the SMS sending mechanism. The researcher stresses that success depends on luck and can take a long time, and that the SMS abuse was fixed as well.

Fix

The researcher recommended implementing rate limiting on https://p.grabtaxi.com/api/passenger/v2/profiles/activationsms, for example blocking code resending for some time after 5 or more resends. The researcher says the team fixed the issue fast: there is now limiting on code refreshing, and an account can also be locked. The SMS sending abuse was fixed too.

Variants to test

  • Resend endpoints without a cap. Look for any endpoint that issues a fresh OTP, such as activationsms here, and check whether it enforces only a cooldown or also a count limit. A positive result is being able to request a new code repeatedly over hours without the account being locked or the requests being throttled.
  • Short numeric codes. Check the length of OTPs on similar login flows. A 4-digit code gives a 9999-value space; a positive result is a code space small enough that a fixed set of guesses becomes plausible over a long run.
  • Per-code versus per-account attempt limits. Verify whether the attempt limit resets when a new code is issued. A positive result is a 3-attempt limit that can be reset indefinitely by requesting a new code.
  • Fixed-guess loops. Try submitting the same small set of codes (for example 1056, 1057, 1058) on each round rather than random values, and watch for a success response and a session header. A positive result is a session issued for an account you do not control.
  • SMS volume as a side channel. Monitor how many SMS messages a target number receives during testing. A positive result is a large number of codes being sent to a victim, which is both an abuse signal and evidence that the resend path is unthrottled.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

You install it on a phone, and to use it you need an account. One way to log in is the "Login with mobile number" option: you type your phone number, Grab sends you a short numeric code by SMS, and you type that code into the app. If the code matches, you are logged in. No password is involved at all in this flow.

A security researcher found that this SMS code could be guessed. Not by magic, but by being patient. The code was only 4 digits long, and the part of Grab's system that sends a fresh code had no limit on how often you could ask for one. So an attacker could keep trying a few chosen codes, ask for a new code every 30 seconds, and repeat for hours or days until one of the guesses happened to match. When it matched, the attacker was logged in as the victim. That is called account takeover: someone else gets into your account.

The researcher reported it to Grab through the HackerOne bug bounty platform. Grab fixed it quickly, and the researcher thanks the team for the bounty.

This article walks through the report from the beginning, explaining every technical idea as it comes up, so you can follow it even if you have never done security work before.

The pieces involved

Before the attack makes sense, you need to know what the moving parts are.

The app. The target is the Grab Android passenger app. It is distributed through Google Play under the package name com.grabtaxi.passenger. A package name is the unique identifier Android uses for an app, a bit like a surname that no other app can share. Grab accounts can be created and used from any country.

The API. When the app talks to Grab's servers, it does not send a human-readable web page. It sends requests to an API. An API (Application Programming Interface) is the set of addresses and rules a program uses to ask a server to do something. A useful comparison: a website is a restaurant's dining room, with menus and waiters; an API is the kitchen door where the app hands in an order slip and gets back a plate. The app is the customer, the API is the counter, and the server is the kitchen.

The endpoints. An endpoint is one specific address on that API, one order window. This report is about two of them, both on the host p.grabtaxi.com:

  • https://p.grabtaxi.com/api/passenger/v2/profiles/activationsms, which asks Grab to send (or resend) the SMS activation code.
  • https://p.grabtaxi.com/api/passenger/v2/profiles/activate, which submits a code for checking.

In normal use, the first endpoint is what happens when you tap "send me the code", and the second is what happens when you type the code in and press continue. The first one sends; the second one checks.

OTP. OTP stands for one-time password. It is the short code sent by SMS. It is called one-time because it is meant to be used once and then thrown away. The whole security of the login rests on the idea that only the person holding the phone can read the SMS.

Horizontal privilege escalation. This is a phrase from the report's background. Privilege escalation means getting more access than you should have. Vertical escalation means going from a normal user to an administrator. Horizontal escalation means getting into another account that has the same level of rights as yours, in other words, someone else's ordinary user account. The researcher had previously reported a two-factor authentication (2FA) bypass on the Profile Edit endpoint, and this report continues that line of work by looking for an endpoint that would allow horizontal escalation.

2FA. Two-factor authentication means logging in with two different things, usually something you know (a password) plus something you have (a phone that receives a code). Bypassing 2FA means getting past that second check without possessing the phone.

The setup the researcher used

The researcher did not use a physical phone. The report lists three tools:

  1. Nox App Player, an Android emulator. An emulator is a program that pretends to be a phone on your computer, so you can run Android apps in a window. The emulator's network traffic was sent through a web debugging proxy.
  2. A web debugging proxy. A proxy sits between your program and the internet and can show you every request and response going past, like a post office clerk who opens every envelope and writes down what is inside before sending it on. This is how the researcher could see exactly what the app was sending to Grab's servers, and later replay or automate those requests.
  3. The Grab passenger app from Google Play, which, as noted, allows registration from any country.
  4. A custom C# tool written by the researcher to refresh SMS codes. C# is a programming language; the tool requires .NET 4.0, which is the software framework needed to run it. The source code was attached to the report.

The only input the attack needs is a phone number, including its country code, that is connected to a Grab account. The researcher's own test number is redacted in the report as ███.

Why the attack works

Two facts about the code flow combine into the problem.

Fact one: the code is short. The activation code had only 4 digits. That means there are only 10,000 possible codes, from 0000 to 9999. The report says the code range has 9999 values. The researcher notes that with 5 or 6 digits the chance of guessing drops dramatically, and that even with 4 digits the tool can run for a week without a result. A comparison: guessing a 4-digit code is like guessing a four-wheel combination lock. There are not that many combinations, and if you can keep turning the wheels, you will eventually land on the right one.

Fact two: you can ask for a new code as often as you like. The resend endpoint had no rate limiting. Rate limiting is a rule that says "you may do this only so many times per minute or per hour". Without it, the only restriction was a 30 second wait between resends. So the attacker could request a fresh code every 30 seconds, forever, with no cap on the total number of requests.

Meanwhile, the activation endpoint did have a limit: 3 attempts, after which the code expires. On its own, that is a sensible defence. Three guesses out of 10,000 is hopeless. But the limit applies to one code. If you can throw that code away and get a new one every 30 seconds, the 3-attempt budget resets indefinitely. The defence is scoped to a single code, not to the account or the phone number over time, so it does not stop a patient attacker.

The researcher credits the technique to @yaworsk and the earlier report #149598, and links that report as an example of a similar method. The technique depends heavily on luck: the chance of guessing the right code within 3 attempts in 30 seconds is low, and the server may not issue one of the chosen codes for a very long time. Account takeover is therefore not easy and requires a lot of time. A side effect is abuse of the SMS sending mechanism, because the victim's phone receives many messages; the researcher says that was fixed too.

The arithmetic

The report does the sums explicitly. With 3 attempts every 30 seconds, that is 6 attempts per minute, 360 attempts per hour, and 8640 attempts in 24 hours. Since the code space has only 9999 values, the researcher expected to hit the correct code within 24 to 72 hours.

A table makes the scaling clear:

Period Attempts
30 seconds 3
1 minute 6
1 hour 360
24 hours 8640

The point is not that any single guess is likely. The point is that the attacker is not limited to one round. Over a day or three, the number of guesses approaches the size of the whole code space.

Exploitation, step by step

Step 1: Choose a small set of fixed codes

The attacker picks a few custom OTP codes, for example 1056, 1057 and 1058, and submits those same values on every round rather than random ones. Why fixed values? Because the attacker wants to know which code to watch for. If the server ever issues one of those three, the next submission of that same value will be accepted. Random guesses would work too, but fixed guesses make the loop simple and the success easy to spot.

Step 2: Submit the three attempts

Each round sends the three chosen codes to the activation endpoint:

HTTP
https://p.grabtaxi.com/api/passenger/v2/profiles/activate

This is the address the app calls when it checks a code. In the app, this happens when you type the SMS code and tap the button. In the researcher's tool, it happens three times per round, once for each chosen code. If any of the three is the code the server currently has outstanding, it is accepted. If all three fail, the code is considered expired after the 3-attempt limit, and the attacker moves to the next step.

Step 3: Refresh the code and repeat

After a failed round, the tool calls the resend endpoint to obtain a new code:

HTTP
https://p.grabtaxi.com/api/passenger/v2/profiles/activationsms

This is the address the app calls when it asks Grab to send the SMS. The only restriction here is the 30 second wait between resends. Once that window passes, the tool sends the same three codes again. The researcher describes the loop as: try the three codes, and if all fail, reset and try again in the next 30 seconds. Sooner or later the Grab server issues one of the chosen codes, that code is accepted, and the attacker gains access to the victim's account.

test.PNG
test.PNG From the original on HackerOne

The screenshot test.png shows how the attack looks in the web debugger.

Step 4: Run the proof-of-concept tool

A proof of concept (POC) is a small program that demonstrates a vulnerability really works, without being a polished attack tool. The reproduction steps in the report are:

  1. Use the POC tool attached to the report (C#, requires .NET 4.0, sources included).
  2. Enter the test phone number in the field. It must start with the country code without + and must be connected to the Grab account on the Android app. Alternatively, use the researcher's test number ███ and press Start.
  3. The tool sends the three code attempts 1056, 1057, 1058 and refreshes the code every 30 seconds when they fail. The process may take many hours, but eventually a success response and a session header are returned.

A session header is the piece of the server's reply that carries the login session. When you log in to a website, the server gives your browser a token, often stored in a cookie, and the browser sends it back with every later request so the server knows who you are. A header is one of the labelled fields in an HTTP request or response, the metadata around the actual content. A session header here means the server has accepted the code and issued a session, in other words, the attacker is now logged in as the victim.

prog.PNG
prog.PNG From the original on HackerOne

Root cause

The design flaw is the mismatch between two limits. The activation endpoint limits verification to 3 attempts per code, which on its own would make guessing impractical. The resend endpoint has no rate limiting at all; it only enforces a 30 second delay between resends. Because a new code can be requested every 30 seconds indefinitely, the 3-attempt budget is effectively unlimited over time, and the 4-digit code space of 9999 values becomes reachable. The 3-attempt limit applies to one code, and a new code can be requested every 30 seconds.

Impact

An attacker can bypass OTP verification in the Grab Android app for any mobile number using the "Login with mobile number" option, and can take over any user's account without any privileges, using only the phone number and country code. Because no password is required at login, a successful guess is full account takeover. The victim is not silent: they will receive a few incoming SMS messages with codes, so they will be informed that something is wrong. The attack also abuses the SMS sending mechanism. The researcher stresses that success depends on luck and can take a long time, and that the SMS abuse was fixed as well.

Fix

The researcher recommended implementing rate limiting on https://p.grabtaxi.com/api/passenger/v2/profiles/activationsms, for example blocking code resending for some time after 5 or more resends. The researcher says the team fixed the issue fast: there is now limiting on code refreshing, and an account can also be locked. The SMS sending abuse was fixed too.

Variants to test

If you are learning to look for this kind of bug, these are the patterns to check on other products.

  • Resend endpoints without a cap. Look for any endpoint that issues a fresh OTP, such as activationsms here, and check whether it enforces only a cooldown or also a count limit. A positive result is being able to request a new code repeatedly over hours without the account being locked or the requests being throttled.
  • Short numeric codes. Check the length of OTPs on similar login flows. A 4-digit code gives a 9999-value space; a positive result is a code space small enough that a fixed set of guesses becomes plausible over a long run.
  • Per-code versus per-account attempt limits. Verify whether the attempt limit resets when a new code is issued. A positive result is a 3-attempt limit that can be reset indefinitely by requesting a new code.
  • Fixed-guess loops. Try submitting the same small set of codes (for example 1056, 1057, 1058) on each round rather than random values, and watch for a success response and a session header. A positive result is a session issued for an account you do not control.
  • SMS volume as a side channel. Monitor how many SMS messages a target number receives during testing. A positive result is a large number of codes being sent to a victim, which is both an abuse signal and evidence that the resend path is unthrottled.

Glossary

  • 2FA (two-factor authentication): logging in with two different kinds of proof, typically a password plus a code sent to your phone.
  • Account takeover: an attacker gaining access to someone else's account.
  • API (Application Programming Interface): the set of addresses and rules a program uses to ask a server to do something, as opposed to a website meant for humans.
  • Cookie: a small piece of data a website stores in your browser and that your browser sends back on later requests, often used to remember that you are logged in.
  • C#: a programming language, here used to write the proof-of-concept tool.
  • .NET 4.0: the software framework needed to run the C# tool.
  • Emulator: a program that imitates a phone on a computer so Android apps can run.
  • Endpoint: one specific address on an API that performs one action.
  • Header: a labelled field in an HTTP request or response carrying metadata, such as a session token.
  • Horizontal privilege escalation: getting into another account at the same privilege level as your own.
  • HTTP: the protocol browsers and apps use to talk to web servers.
  • OTP (one-time password): a short code meant to be used once, here sent by SMS.
  • Package name: the unique identifier Android uses for an app, such as com.grabtaxi.passenger.
  • POC (proof of concept): a small program that demonstrates a vulnerability really works.
  • Proxy: a program that sits between your program and the internet and can show or modify the traffic passing through.
  • Rate limiting: a rule that allows an action only a certain number of times per period.
  • Session: the server's record that you are logged in, usually represented by a token sent back and forth.
  • Session header: the part of a server response that carries the session token.
  • SMS: the text message system used to deliver the OTP.
  • Token: a value that stands in for your identity, so you do not have to send your password with every request.
  • Vertical privilege escalation: going from a normal user to a more powerful role such as administrator.
  • Web debugging proxy: a proxy that records and displays the requests and responses between an app and a server.

More by sp1d3rs

View all

62 more disclosed reports, best first.

More from Grab

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.