Skip to content
IDOR Write-up Intermediate

Uber Account Takeover: The API That Handed Out Tokens

A partner API leaked internal user UUIDs in error messages, and a separate consent-screen endpoint accepted a user UUID from the request body and returned that user's mobile auth token without checking the session. An attacker could use a phone number or email to obtain the UUID and then retrieve the victim's live session token, leading to account takeover.

Muhammad Asim Shahzad Follow

Published on masimshahzad.medium.com

Bug Bounty

Muhammad Asim Shahzad, on masimshahzad.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.

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

Uber's platform covers riders, drivers and Eats customers, and the account takeover described here chained two API behaviours that each looked harmless on their own. The first was a partner-side API used to add drivers, which accepted a phone number or email address as input. The second was an endpoint built to render a consent screen, which took a user UUID from the request body and returned that user's profile.

Neither endpoint was meant to hand out credentials. The consent screen endpoint was a UI helper: given a user identifier, it returned the data needed to draw the consent page. The driver-adding API was a lookup helper for partner integrations. The report describes what happened when the output of one was fed into the other.

The case was reported by Anand Prakash in April 2019, and Uber fixed it within a week of the report. The bounty was $6,500. The HackerOne report is #542340, rated High, and it was disclosed in September 2019; the researcher first published his account of it in September 2019 on HackerNoon.

AI-generated illustration From the original on masimshahzad.medium.com

Setup

The report does not describe a lab setup, tooling, versions or test accounts in any detail. What it does establish is the precondition for the whole chain: the attacker needs a contact detail belonging to the victim, either a phone number or an email address. No authenticated session on the victim's side is required for the first step, and the second step is driven by the UUID obtained from the first.

Finding it

The researcher noticed that two separate API responses, each unremarkable in isolation, combined into something much worse.

The first was an identifier leak in an error message. The partner-side API for adding drivers accepted a phone number or email. When the lookup failed, the error message echoed back the internal user UUID tied to that contact detail. In other words, a failed request still told the caller which internal user the contact detail belonged to.

The second was an insecure direct object reference. The consent screen endpoint read a user UUID straight from the request body and returned that user's profile. Nothing compared the UUID in the request with the session making the request. Uber's own disclosure summary states that the response also carried the user's mobile auth token.

Each bug on its own is limited: an identifier leak gives you an internal ID, and an IDOR on a profile endpoint gives you profile data. Chained, the second converts the first into a credential.

Exploitation

Step 1: leak the internal UUID from the driver-adding API

Send a phone number or email address to the partner-side API used for adding drivers. When the lookup fails, the error response echoes the internal user UUID associated with that contact detail. The report does not reproduce the request or the response body, so the exact parameter names and error format are not shown.

What matters is the behaviour: a failure path returns a sensitive identifier rather than a generic error. The attacker now holds the victim's internal UUID, derived from nothing more than a contact detail.

Step 2: exchange the UUID for the mobile auth token

Call the consent screen endpoint with the UUID from step 1 in the request body. The endpoint returns the user's profile, and according to Uber's disclosure summary the response also contains the user's mobile auth token. The report does not reproduce this request or response either.

The endpoint performs no check that the UUID in the body matches the identity of the session making the call. That is the IDOR: the object reference is user-controlled and the authorisation decision is missing.

Step 3: use the token

With the victim's mobile token, the researcher reports he could view ride history, request rides and see payment details on test accounts. Location history, saved addresses and driver information were exposed as well. The report does not describe the specific requests used against the mobile API.

Root cause

Two design mistakes combine here.

  1. Sensitive data in error messages. The driver-adding API treats the error path as a debugging aid and returns the internal UUID tied to the contact detail. An error message is an API response and should be reviewed like one.
  2. Identity taken from the request instead of the session. The consent screen endpoint reads user_uuid from the request body and loads that user, without comparing it to the session's own user. The report's own analysis puts it plainly: if an endpoint serves "the current user", it must never read a user ID from the request.

A third factor makes the chain practical: UUIDs are treated as if unguessable meant authorised. They are not secret, and once one leaks, any endpoint that trusts a caller-supplied UUID is exposed.

Impact

With a victim's mobile token, the researcher reports he could view ride history, request rides and see payment details on test accounts. For a ride-hailing platform that is physical-safety data.

The only input needed was a contact detail: a phone number or an email address.

The report rates the issue High on HackerOne. The $6,500 bounty comes from the researcher's write-up and is not shown on the public report.

Fix

Uber fixed the issue within a week of the report. The defensive pattern it sets out is:

  1. Derive identity from the session. If an endpoint serves "the current user", it must never read a user ID from the request.
  2. Never return credentials in data responses. Tokens are issued by the auth service at login, never by a profile or UI helper.
  3. Make errors boring. "Not found" should not include the ID of the thing that was found.
  4. Treat UUIDs as public. Unguessable is not authorised.

The article's own analysis includes a sketch of a corrected consent handler:

Python
PUBLIC_FIELDS = {"first_name", "role", "locale"}

def consent_screen_details(request):
    session = require_session(request)
    asked = request.body.get("user_uuid")
    if asked is not None and asked != session.user_uuid:
        audit_log("uuid_mismatch", session.user_uuid)
        return error(403, "forbidden")

    user = load_user(session.user_uuid)
    return {k: user[k] for k in PUBLIC_FIELDS}

The handler requires a session, rejects a body UUID that does not match the session's own user (logging the mismatch), loads the user from the session rather than the request, and returns only a fixed set of public fields.

Variants to test

  • Error messages that echo identifiers. Send a contact detail, an order number or a username to lookup and creation endpoints and read the failure response. A positive result is an error body containing an internal ID, UUID, email or any field the caller should not have.
  • Body-supplied user IDs on UI helpers. Take any endpoint that renders a consent screen, profile card or settings page and replace the user identifier in the body with another account's. A positive result is another user's data coming back, especially anything token-shaped.
  • Tokens in profile responses. Inspect every response from profile and UI endpoints for fields that look like credentials: mobile auth tokens, session identifiers, refresh tokens. A positive result is a credential issued outside the login flow.
  • UUID mismatch handling. Send a body UUID that differs from the session's own and observe the response. A positive result is a 200 with the other user's data; a 403 with an audit log entry is the fixed behaviour.
  • Chained identifier leaks. Where one endpoint leaks an identifier and another trusts a caller-supplied one, try the pair together. A positive result is a full account takeover from a single contact detail.

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. 15 min read.

What happened, in plain words

Uber is an app you use to order a car, and Uber Eats is the food delivery side of the same company. All of these services run on accounts: you sign in once, and the app remembers you. Behind the scenes, that remembering is done with a small piece of text called a token, which works a bit like a wristband at a festival. You show the wristband at the gate and you get in; you do not have to show your passport every time.

In April 2019 a security researcher named Anand Prakash found a way to get somebody else's wristband. He did it by combining two small mistakes in Uber's systems, neither of which looked dangerous on its own. The first mistake was that one of Uber's systems, when asked about a phone number or email address it did not recognise, replied with an internal identifier for the person who owned that contact detail. The second mistake was that another system, the one that draws a consent screen, would happily accept any user identifier you gave it and hand back that person's profile, including their live mobile session token.

Put together: give a phone number, get an internal ID; give the internal ID, get a token; use the token, and you are that person. Uber fixed it within a week of the report and paid a $6,500 bounty. The HackerOne report is #542340, rated High, and it was disclosed in September 2019. The researcher first published his account of it in September 2019 on HackerNoon.

AI-generated illustration From the original on masimshahzad.medium.com

The illustration above is an AI-generated image that heads the article.

Before going further, a few words that will come up constantly.

  • An API (application programming interface) is the set of doors a program uses to talk to another program. When you tap a button in the Uber app, the app does not do the work itself; it sends a message to an Uber server and the server sends an answer back. That message and answer are the API. Think of a restaurant: the menu and the waiter are the API, the kitchen is the server. You do not walk into the kitchen yourself.
  • A request is the message the app sends. A response is the answer that comes back.
  • A token is a short string of characters that proves who you are, so you do not have to type your password on every screen. It is the festival wristband.
  • A session is the period during which the server treats you as signed in. The token is what ties your requests to your session.
  • A UUID (universally unique identifier) is a long random-looking string used to name a thing internally, for example 3f2b8c1e-.... It is like a customer number in a shop's database: the shop uses it to find your record, but it is not your name and it is not a password.
  • An endpoint is one specific door in the API. One endpoint might be "look up a driver", another "show a consent screen". Each has its own address and its own rules.
  • Authentication means proving who you are. Authorisation means deciding what you are allowed to do once you have proved it. Logging in is authentication; being told you cannot open someone else's file is authorisation.

Context

Uber's platform covers riders, drivers and Eats customers, and the account takeover described here chained two API behaviours that each looked harmless on their own. The first was a partner-side API used to add drivers, which accepted a phone number or email address as input. The second was an endpoint built to render a consent screen, which took a user UUID from the request body and returned that user's profile.

Neither endpoint was meant to hand out credentials. The consent screen endpoint was a UI helper: given a user identifier, it returned the data needed to draw the consent page. The driver-adding API was a lookup helper for partner integrations. The report describes what happened when the output of one was fed into the other.

A partner-side API is an API meant for other businesses rather than for ordinary users. Uber works with partners, for example companies that manage drivers, and those partners need a way to add drivers to the platform. That is what the driver-adding API was for.

A consent screen is the page that asks you to agree to something, such as sharing your data with a third party. To draw that page, the app needs a little information about you: your name, your role, your language. The endpoint that supplied that information is what the report calls a UI helper, meaning a small service whose only job is to help the screen display correctly.

A credential is anything that proves identity: a password, a token, a key. Neither endpoint was supposed to produce one. The consent screen was supposed to draw a page; the driver API was supposed to look things up.

The case was reported by Anand Prakash in April 2019, and Uber fixed it within a week of the report. The bounty was $6,500. The HackerOne report is #542340, rated High, and it was disclosed in September 2019; the researcher first published his account of it in September 2019 on HackerNoon.

A bug bounty is a programme in which a company pays outside researchers for finding and reporting security problems. HackerOne is one of the platforms that runs such programmes. A bounty is the payment. Disclosed means the report was made public, usually some months after the fix, so that others can learn from it.

Setup

The report does not describe a lab setup, tooling, versions or test accounts in any detail. What it does establish is the precondition for the whole chain: the attacker needs a contact detail belonging to the victim, either a phone number or an email address. No authenticated session on the victim's side is required for the first step, and the second step is driven by the UUID obtained from the first.

That precondition is worth pausing on. The attacker does not need the victim's password, does not need the victim to click anything, and does not need to be signed in as the victim. A phone number or an email address is enough to start. Contact details are not secret: they are on business cards, in group chats, in delivery notes. This is why the chain mattered so much.

Finding it

The researcher noticed that two separate API responses, each unremarkable in isolation, combined into something much worse.

The first was an identifier leak in an error message. The partner-side API for adding drivers accepted a phone number or email. When the lookup failed, the error message echoed back the internal user UUID tied to that contact detail. In other words, a failed request still told the caller which internal user the contact detail belonged to.

An identifier leak means a system reveals an internal name for something when it should not. Imagine asking a hotel reception "is Mr Smith staying here?" and, instead of "I cannot tell you", being told "no guest by that name, but room 412 is booked under that phone number". The refusal itself carried the answer.

The second was an insecure direct object reference. The consent screen endpoint read a user UUID straight from the request body and returned that user's profile. Nothing compared the UUID in the request with the session making the request. Uber's own disclosure summary states that the response also carried the user's mobile auth token.

Insecure direct object reference, usually shortened to IDOR, is a mouthful for a simple idea. Many APIs work by being told which object you want: give me record 412. An IDOR happens when the API fetches whatever object you name without checking that the object belongs to you. Think of a cloakroom: you hand over ticket 412 and get coat 412. If the attendant never checks that ticket 412 is yours, you can hand over any number and walk away with a stranger's coat. The "object reference" is the number; "insecure" means nobody checked.

A request body is the part of a request that carries data, as opposed to the address of the endpoint. If the endpoint is the envelope's address, the body is the letter inside. Here the body contained a field called user_uuid, and the server trusted it.

A mobile auth token is the token the Uber mobile app uses to stay signed in. Whoever holds it is treated by the mobile API as the account owner.

Each bug on its own is limited: an identifier leak gives you an internal ID, and an IDOR on a profile endpoint gives you profile data. Chained, the second converts the first into a credential.

Exploitation

Step 1: leak the internal UUID from the driver-adding API

Send a phone number or email address to the partner-side API used for adding drivers. When the lookup fails, the error response echoes the internal user UUID associated with that contact detail. The report does not reproduce the request or the response body, so the exact parameter names and error format are not shown.

What matters is the behaviour: a failure path returns a sensitive identifier rather than a generic error. The attacker now holds the victim's internal UUID, derived from nothing more than a contact detail.

Why take this step at all? Because the second endpoint needs a UUID, and the attacker does not have one. The driver-adding API is a way to turn a public fact (a phone number) into an internal fact (a UUID). The attacker is not trying to add a driver; he is using the error message as a lookup service.

Step 2: exchange the UUID for the mobile auth token

Call the consent screen endpoint with the UUID from step 1 in the request body. The endpoint returns the user's profile, and according to Uber's disclosure summary the response also contains the user's mobile auth token. The report does not reproduce this request or response either.

The endpoint performs no check that the UUID in the body matches the identity of the session making the call. That is the IDOR: the object reference is user-controlled and the authorisation decision is missing.

Why does this work? Because the endpoint was written to answer the question "what should I draw on this consent screen?" and it took the answer to "whose screen?" from the caller. It never asked "and are you that person?". The missing question is the whole vulnerability.

Step 3: use the token

With the victim's mobile token, the researcher reports he could view ride history, request rides and see payment details on test accounts. Location history, saved addresses and driver information were exposed as well. The report does not describe the specific requests used against the mobile API.

Why is this the payoff? Because the token is the wristband. Once you have it, you do not need to break anything else; you simply present it, and the mobile API treats you as the account owner. The report says payment details were seen on test accounts.

Root cause

Two design mistakes combine here.

  1. Sensitive data in error messages. The driver-adding API treats the error path as a debugging aid and returns the internal UUID tied to the contact detail. An error message is an API response and should be reviewed like one.
  2. Identity taken from the request instead of the session. The consent screen endpoint reads user_uuid from the request body and loads that user, without comparing it to the session's own user. The report's own analysis puts it plainly: if an endpoint serves "the current user", it must never read a user ID from the request.

A third factor makes the chain practical: UUIDs are treated as if unguessable meant authorised. They are not secret, and once one leaks, any endpoint that trusts a caller-supplied UUID is exposed.

That last point is a common misunderstanding. A UUID looks random, and random looks safe, but "hard to guess" and "allowed to see" are different questions. A long random string is still just a name. If an API hands out data to anyone who knows the name, then the name is as good as a password, except it was never treated like one.

Impact

With a victim's mobile token, the researcher reports he could view ride history, request rides and see payment details on test accounts. For a ride-hailing platform that is physical-safety data.

Why does that matter more than, say, a leaked shopping list? Because ride history and location history describe where a person physically was and when. Saved addresses include home and work. Payment details are financial. For a driver, the exposure includes driver information. This is not abstract data about clicks; it is data about bodies moving through the world.

The only input needed was a contact detail: a phone number or an email address.

The report rates the issue High on HackerOne. The $6,500 bounty comes from the researcher's write-up and is not shown on the public report.

Fix

Uber fixed the issue within a week of the report. The defensive pattern it sets out is:

  1. Derive identity from the session. If an endpoint serves "the current user", it must never read a user ID from the request.
  2. Never return credentials in data responses. Tokens are issued by the auth service at login, never by a profile or UI helper.
  3. Make errors boring. "Not found" should not include the ID of the thing that was found.
  4. Treat UUIDs as public. Unguessable is not authorised.

The article's own analysis includes a sketch of a corrected consent handler:

Python
PUBLIC_FIELDS = {"first_name", "role", "locale"}

def consent_screen_details(request):
    session = require_session(request)
    asked = request.body.get("user_uuid")
    if asked is not None and asked != session.user_uuid:
        audit_log("uuid_mismatch", session.user_uuid)
        return error(403, "forbidden")

    user = load_user(session.user_uuid)
    return {k: user[k] for k in PUBLIC_FIELDS}

Line by line, in plain words:

  • PUBLIC_FIELDS = {"first_name", "role", "locale"} sets up a short list of the only fields this endpoint is ever allowed to return: first name, role and language setting. Anything else, including a token, cannot come out of this function because it is not on the list.
  • def consent_screen_details(request): starts the function that handles the consent screen request.
  • session = require_session(request) first demands a valid session. If the caller is not signed in, the function stops here. This is the authentication gate.
  • asked = request.body.get("user_uuid") reads the UUID the caller put in the request body, if any. Note that it is only read, not trusted.
  • if asked is not None and asked != session.user_uuid: compares the requested UUID with the UUID of the signed-in session. If the caller asked for somebody else, the two differ.
  • audit_log("uuid_mismatch", session.user_uuid) records the mismatch in an audit log, so the attempt is visible later. An audit log is a record of security-relevant events kept for review.
  • return error(403, "forbidden") refuses the request. 403 is the standard HTTP status code for "I know who you are, and you are not allowed".
  • user = load_user(session.user_uuid) loads the user from the session, not from the request. This is the core of the fix: identity comes from the wristband, not from the number the caller wrote down.
  • return {k: user[k] for k in PUBLIC_FIELDS} builds the response using only the fields on the public list, so no credential can slip out even if the user record contains one.

The handler requires a session, rejects a body UUID that does not match the session's own user (logging the mismatch), loads the user from the session rather than the request, and returns only a fixed set of public fields.

Variants to test

If you ever look at an API with permission, these are the patterns to try. Each one is a question you are asking the system, and the answer tells you whether the door is locked.

  • Error messages that echo identifiers. Send a contact detail, an order number or a username to lookup and creation endpoints and read the failure response. A positive result is an error body containing an internal ID, UUID, email or any field the caller should not have. The idea: deliberately fail, and see whether the failure talks too much.
  • Body-supplied user IDs on UI helpers. Take any endpoint that renders a consent screen, profile card or settings page and replace the user identifier in the body with another account's. A positive result is another user's data coming back, especially anything token-shaped. The idea: change the number on the cloakroom ticket and see whether the attendant notices.
  • Tokens in profile responses. Inspect every response from profile and UI endpoints for fields that look like credentials: mobile auth tokens, session identifiers, refresh tokens. A positive result is a credential issued outside the login flow. The idea: a profile page should describe you, not arm you.
  • UUID mismatch handling. Send a body UUID that differs from the session's own and observe the response. A positive result is a 200 with the other user's data; a 403 with an audit log entry is the fixed behaviour. The idea: test the exact check the corrected code above performs.
  • Chained identifier leaks. Where one endpoint leaks an identifier and another trusts a caller-supplied one, try the pair together. A positive result is a full account takeover from a single contact detail. The idea: two locks that are each weak can still be opened by the same key.

Glossary

  • API: the set of doors one program uses to talk to another; the menu and waiter between your app and the server.
  • Request: the message an app sends to a server.
  • Response: the answer the server sends back.
  • Endpoint: one specific door in an API, with its own address and rules.
  • Request body: the part of a request that carries data, as opposed to the address.
  • Token: a short string that proves who you are so you do not retype your password; the festival wristband.
  • Mobile auth token: the token the Uber mobile app uses to stay signed in.
  • Session: the period during which the server treats you as signed in.
  • UUID: a long random-looking internal identifier for a record; a customer number, not a password.
  • Authentication: proving who you are.
  • Authorisation: deciding what you are allowed to do once you have proved it.
  • Credential: anything that proves identity, such as a password or token.
  • Partner-side API: an API meant for other businesses rather than ordinary users.
  • Consent screen: the page that asks you to agree to something, such as sharing data with a third party.
  • UI helper: a small service whose only job is to supply data so a screen can display.
  • Identifier leak: a system revealing an internal name for something when it should not.
  • IDOR (insecure direct object reference): an API fetches whatever object you name without checking it belongs to you; the unchecked cloakroom ticket.
  • Account takeover: gaining control of somebody else's account.
  • Bug bounty: a programme that pays outside researchers for finding and reporting security problems.
  • Bounty: the payment made under such a programme.
  • Disclosed: made public, usually some months after the fix.
  • Audit log: a record of security-relevant events kept for later review.
  • 403: the standard HTTP status code for "I know who you are, and you are not allowed".
  • CWE: a catalogue of common weakness types used to classify security bugs.

More by Muhammad Asim Shahzad

View all

21 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.