Skip to content
Info disclosure Write-up Beginner

Leakage of Client Secret, Server tokens of all Uber developer applications

An API endpoint on riders.uber.com returned the client secret and server tokens of any Uber developer application connected to a user's account. An attacker could connect an application to their own account and then retrieve that application's confidential credentials.

Anand Prakash Follow

Published on medium.com

Bounty$5,000 View original

The vulnerability detailed in this blog post is being disclosed by Anand Prakash and Manisha Sangwan of team AppSecure. This was plugged quickly by the engineering team at Uber.

Anand Prakash (@anandpraka_sh), 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.

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 runs a developer platform on top of its rider and driver APIs. Third-party applications such as IFTTT, Payfare and Bixby are authorised by an account owner through OAuth, and once connected they can access parts of that user's Uber account. Each such application has credentials: a client ID, a client secret, and server tokens. Uber's own documentation, quoted in the write-up, describes the secret as follows:

"The secret for your application, this should be treated like your application's password. Never share this with anyone, check this into source code, or post in any public forum. Additionally, this should not be distributed on client devices where users could decompile your code and access the secret. If you suspect your client_secret has been compromised you may generate a new one in your application's dashboard which will immediately invalidate the old secret."

The feature involved is the profile page at https://riders.uber.com/profile, which lists the applications a rider has authorised. The page is backed by a JSON API that returns details about those connected applications. That API is the subject of the report.

The vulnerability was found and disclosed by Anand Prakash and Manisha Sangwan of AppSecure, and published with Uber's permission under its responsible disclosure policy.

Setup

The precondition is a normal Uber rider account able to complete the OAuth flow that connects a third-party Uber developer application to it. The only requirement is the ability to complete the OAuth flow that connects a third-party Uber developer application to that account, which the report describes as not a complicated procedure.

The work was done against the production site riders.uber.com. The request shown below was sent from Firefox 62 on macOS 10.13, using the attacker's own authenticated session.

Finding it

The researchers identified a public API endpoint behind the profile page, POST /api/getAuthorisedApps on riders.uber.com, which returns information about the applications authorised by the account owner. The response went well beyond what the page needs to display: alongside the application name and scopes it included the application's client secret and its server tokens.

That is wrong because those values are the application's own credentials, not data belonging to the rider who authorised it. The rider has no legitimate need to see them, and the application owner certainly does not expect them to be handed to every user who connects the app.

Exploitation

Step 1: connect an application

The attacker connects a random Uber developer application to their own account using OAuth. The report gives IFTTT, Payfare and Bixby as examples of such applications. Nothing else is needed at this stage: the attacker is acting as an ordinary user granting access.

Step 2: read the credentials from the profile API

With the application connected, the attacker calls the endpoint using their own session data. The request as recorded in the report:

HTTP
POST /api/getAuthorisedApps HTTP/1.1
Host: riders.uber.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://riders.uber.com/profile
content-type: application/json
x-csrf-token: XXX
origin: https://riders.uber.com
Content-Length: 2
Cookie:

The request is a JSON POST to the profile API with the headers shown, including an x-csrf-token value. The Origin and Referer headers are those of the legitimate profile page. The Content-Length header is 2.

The response contained the following data:

The sensitive fields sit inside scopeDetails[].applicationDetails. applicationSecret is the client secret of the connected application, and serverTokens is an array of that application's server tokens. The same object also exposes the application's internal identifiers (applicationID), its owner's userUUID, the userUUID of its admins and developers, its redirect URIs, its scope configuration and its creation and update timestamps. The report notes that the response also carried other significant information about the application, not only the two credential fields.

Because the endpoint answers for whatever applications the caller has connected, an attacker can repeat the flow for any Uber developer application on production and read that application's secret and server tokens from the response.

Root cause

The profile API returned the application's client secret and server tokens to the rider alongside other application details. The endpoint returned the credentials of applications the rider had connected. The report does not describe the server-side code.

OAuth consent limits which applications appear in the response, but the attacker chooses which applications to connect, so that limit is under the attacker's control.

Impact

An attacker with an ordinary Uber account could obtain the client secret and server tokens of any Uber developer application on production, provided they first connect that application to their account through OAuth. The documentation warns that the secret should be treated like the application's password and never shared. The response also disclosed internal identifiers and the UUIDs of the application's owner, admins and developers.

The report does not enumerate which applications were affected beyond naming IFTTT, Payfare and Bixby as examples of developer applications, and it does not state how many applications or users were exposed.

Fix

Uber fixed the issue by removing the secret and token data from the API response, and AppSecure verified the fix. Uber publicly notified all developers about the vulnerability and asked them to rotate secrets on a periodic basis. The notification sent to developers is shown below.

Notification sent by Uber to developers. From the original on medium.com

Disclosure timeline

Date Event
October 5th, 2018 Report sent to Uber's security team.
November 6th, 2018 Issue resolved by Uber; AppSecure asked Uber to notify all developers in case their app secret was no longer confidential, and verified the fix.
December 20th, 2018 Uber replied that it was in the process of notifying developers and putting a long-term fix in place.
February 8th, 2019 Uber awarded a $5000 bounty and notified all developers by email. The issue was publicly disclosed after the action was conducted.

Variants to test

  1. Other profile and settings APIs. Enumerate the JSON endpoints behind account pages that list connected apps, sessions, devices or integrations, and inspect every field of the response for credentials, tokens or internal identifiers. A positive result is a field such as a client secret, an API key or a server token that belongs to the third-party integration rather than the account holder.
  2. Object-level authorisation on the same endpoint. Try supplying an application identifier or user identifier in the request body and see whether the response returns details for an application the caller has not connected. A positive result is application details appearing without a corresponding OAuth grant.
  3. Serialisation of internal records. Compare fields returned to the client with fields shown in the UI. Extra fields such as admin lists, developer UUIDs, redirect URIs, webhook URLs or scope configuration suggest the whole internal object is being serialised, which is where credentials tend to leak.
  4. OAuth-connected third-party apps on other platforms. Repeat the connect-then-read flow on any service that lets users link external applications, and check whether the linked-app listing exposes the partner's credentials. A positive result is a secret or token for the partner application in a response scoped to the linking user.
  5. Token rotation behaviour. Where a secret is exposed, check whether rotating it in the application dashboard invalidates the leaked value, as Uber's documentation describes. A positive result confirms the exposure is directly exploitable rather than a stale value.

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

Uber lets other companies build apps that plug into your Uber account. IFTTT, Payfare and Bixby are examples named in the report. You connect one of these apps to your account by signing in and saying yes to a permission screen. That process is called OAuth. Once connected, the app can access parts of your Uber account according to the permissions you grant.

Every one of those apps has its own login details on Uber's side. Two of them matter here: a client secret and server tokens. Think of the client secret like the password of the app itself, not of the person using it. Uber's documentation says it should be treated like the application's password and never shared.

The profile page at https://riders.uber.com/profile shows you which apps you have connected. Behind that page is a small web service, an API, that the page asks for the list. An API is just a way for one piece of software to ask another for data, like a waiter taking your order to the kitchen and bringing back a plate. The problem was that this particular API handed back far too much: not only the app's name, but also the app's client secret and server tokens.

Anand Prakash and Manisha Sangwan of AppSecure found this and reported it to Uber. Uber fixed it and paid a $5000 bounty. The report was published with Uber's permission under its responsible disclosure policy, which is an agreement that a security researcher can tell the public about a bug after the company has had time to fix it.

Background you need

What an API is

When you open a web page, your browser does not usually get the finished page from one place. The page's code often asks a server for raw data and then draws it on screen. That request for raw data goes to an API. The data usually comes back in a format called JSON, which is just text arranged in labelled boxes, a bit like a very structured shopping list.

What a cookie and a token are

When you log in to a website, the site gives your browser a small piece of text called a cookie. Your browser sends it back with every request so the site knows who you are. It works like a wristband at an event: you show it at the door and you get in without showing your ID again. A CSRF token is a second, secret value that the site's own pages include in requests that change or read data, to prove the request really came from the site and not from some other page trying to act on your behalf.

What a client secret and a server token are

A client secret is the password an application uses when it talks to Uber's systems. Uber's own documentation, quoted in the report, says:

"The secret for your application, this should be treated like your application's password. Never share this with anyone, check this into source code, or post in any public forum. Additionally, this should not be distributed on client devices where users could decompile your code and access the secret. If you suspect your client_secret has been compromised you may generate a new one in your application's dashboard which will immediately invalidate the old secret."

A server token is another credential an app can use to call Uber's API from its own servers. Both belong to the app developer, not to the rider who connected the app.

What kind of bug this is

The report calls it information leakage, also known as information disclosure. That means a system gives out data it should have kept private. The everyday comparison is a receptionist who, when asked for the name on a booking, reads out the guest's name, home address and credit card number. The request was reasonable; the answer was not.

Who found it and how it was set up

The vulnerability was found and disclosed by Anand Prakash and Manisha Sangwan of AppSecure, and published with Uber's permission under its responsible disclosure policy.

The attacker needed a normal Uber rider account able to complete the OAuth flow connecting a third-party Uber developer application. The attacker just had to be able to complete the OAuth flow that connects a third-party Uber developer application to their own account. The report describes that as not a complicated procedure.

The work was done against the live production site riders.uber.com. The request shown below was sent from Firefox 62 on macOS 10.13, using the attacker's own logged-in session.

Finding it

The researchers found a public API endpoint behind the profile page, POST /api/getAuthorisedApps on riders.uber.com, which returns information about the applications authorised by the account owner. The response went well beyond what the page needs to display: alongside the application name and scopes it included the application's client secret and its server tokens.

That is wrong because those values are the application's own credentials, not data belonging to the rider who authorised it. The rider has no legitimate need to see them, and the application owner certainly does not expect them to be handed to every user who connects the app.

Exploitation

Step 1: connect an application

The attacker connects a random Uber developer application to their own account using OAuth. The report gives IFTTT, Payfare and Bixby as examples of such applications. Nothing else is needed at this stage: the attacker is acting as an ordinary user granting access. This step matters because the endpoint only answers for apps the caller has connected, so the attacker first has to create that connection.

Step 2: read the credentials from the profile API

With the application connected, the attacker calls the endpoint using their own session data. The request as recorded in the report:

HTTP
POST /api/getAuthorisedApps HTTP/1.1
Host: riders.uber.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:62.0) Gecko/20100101 Firefox/62.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://riders.uber.com/profile
content-type: application/json
x-csrf-token: XXX
origin: https://riders.uber.com
Content-Length: 2
Cookie:

Line by line:

  • POST /api/getAuthorisedApps HTTP/1.1 is the request line. POST is the method, meaning the browser is sending something to the server rather than just asking for a page. /api/getAuthorisedApps is the address of the API on the server, and HTTP/1.1 is the version of the web protocol being used.
  • Host: riders.uber.com tells the server which website the request is for. One server can host many sites, so this is how it knows which one you mean.
  • User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:62.0) Gecko/20100101 Firefox/62.0 identifies the browser and operating system that sent the request. Here it is Firefox 62 on macOS 10.13.
  • Accept: */* says the browser will accept any kind of response.
  • Accept-Language: en-US,en;q=0.5 says the browser prefers English (US), with a lower preference for generic English.
  • Accept-Encoding: gzip, deflate says the browser can accept a compressed response to save bandwidth.
  • Referer: https://riders.uber.com/profile tells the server which page the request came from. Here it is the profile page.
  • content-type: application/json says the body of the request is JSON text.
  • x-csrf-token: XXX carries the CSRF token, the secret value the site's own pages include to prove the request came from the site. XXX stands in for the real value.
  • origin: https://riders.uber.com says which site the request originates from. Servers use this to block requests coming from other sites.
  • Content-Length: 2 says the body is two bytes long, which is consistent with an empty JSON object.
  • Cookie: is where the browser would send the rider's session cookie. The value is left out here.

The request is a JSON POST to the profile API with the headers shown, including an x-csrf-token value. The Origin and Referer headers are those of the legitimate profile page. The body is two bytes long, which is consistent with an empty JSON object.

The response contained the following data:

What the parts of this JSON mean:

  • "status":"success" says the request worked.
  • "data" is the main box holding the answer. Inside it, "data":{"uuid":"xxxx"} is an identifier for the rider who made the call.
  • "clientScopes" lists what the connected app is allowed to do. "authorizedClientScopes" contains a clientID and a list of scopes: history, offline_access and profile. A scope is a permission, like a tick box on a consent form.
  • "scopeDetails" is a list, and each entry has an "applicationDetails" object describing one connected app.
  • Inside applicationDetails, "applicationID" is the app's internal identifier, and "owner" holds the owner's userUUID and an empty userEmail.
  • "applicationSecret":"xxx" is the client secret of the connected application. This is the field that should never have been sent to a rider.
  • "name" and "description" are the app's public name and description.
  • "privacyPolicyURL" is a link to the app's privacy policy.
  • "surgeConfirmedRedirectURI", "webhookURL", "applicationType" and "requestsPerHour" are further configuration fields, mostly empty or zero here.
  • "redirectURIs" lists the addresses the app is allowed to send users back to after login.
  • "appSignatures", "defaultScopes", "whitelistedScopes" and "originURIs" describe how the app is set up and what it may request.
  • "serverTokens":["xxx"] is a list of the app's server tokens, another credential that should have stayed private.
  • "ipWhitelist" lists IP addresses allowed to use the app, empty here.
  • "admins" and "developers" list the people behind the app by userUUID, with empty email fields.
  • "tags", "oauthEnabled", "smsVerificationEnabled", "cobrandingEnabled", "supplyOnly" and "isInternal" are flags and labels about the app.
  • "cobrandingDetails" holds branding settings such as fallback URLs and logo information, all empty here.
  • "availableScopes", "openScopes" and "developerScopes" list the permissions the app can offer or use, such as delivery, history, places, profile, all_trips, request and request_receipt.
  • "createdAt" and "updatedAt" are timestamps for when the app record was created and last changed.
  • "displayName", "iconURL" and "publicDescription" are public-facing details, null here.
  • "appGalleryDetails" holds app store style settings such as mobilePlatforms, publicationState, redirectURI and permissionState.
  • "permissions" and "userRoleInvitations" are null in this response.

The sensitive fields sit inside scopeDetails[].applicationDetails. applicationSecret is the client secret of the connected application, and serverTokens is an array of that application's server tokens. The same object also exposes the application's internal identifiers (applicationID), its owner's userUUID, the userUUID of its admins and developers, its redirect URIs, its scope configuration and its creation and update timestamps. The report notes that the response also carried other significant information about the application, not only the two credential fields.

Because the endpoint answers for whatever applications the caller has connected, an attacker can repeat the flow for any Uber developer application on production and read that application's secret and server tokens from the response.

Why it happened

The profile API returned the application's client secret and server tokens to the rider alongside other application details. The endpoint returned the credentials of applications the rider had connected. The report does not describe the server-side code.

OAuth consent limits which applications appear in the response, but the attacker chooses which applications to connect, so that limit is under the attacker's control.

Impact

An attacker with an ordinary Uber account could obtain the client secret and server tokens of any Uber developer application on production, provided they first connect that application to their account through OAuth. The documentation warns that the secret should be treated like the application's password and never shared. The response also disclosed internal identifiers and the UUIDs of the application's owner, admins and developers.

The report does not enumerate which applications were affected beyond naming IFTTT, Payfare and Bixby as examples of developer applications, and it does not state how many applications or users were exposed.

The fix

Uber fixed the issue by removing the secret and token data from the API response, and AppSecure verified the fix. Uber publicly notified all developers about the vulnerability and asked them to rotate secrets on a periodic basis. Rotating a secret means replacing it with a new one, which makes the old one stop working. The notification sent to developers is shown below.

Notification sent by Uber to developers. From the original on medium.com

Timeline

Date Event
October 5th, 2018 Report sent to Uber's security team.
November 6th, 2018 Issue resolved by Uber; AppSecure asked Uber to notify all developers in case their app secret was no longer confidential, and verified the fix.
December 20th, 2018 Uber replied that it was in the process of notifying developers and putting a long-term fix in place.
February 8th, 2019 Uber awarded a $5000 bounty and notified all developers by email. The issue was publicly disclosed after the action was conducted.

Similar things to look for

  1. Other profile and settings APIs. Look through the JSON endpoints behind account pages that list connected apps, sessions, devices or integrations, and inspect every field of the response for credentials, tokens or internal identifiers. A positive result is a field such as a client secret, an API key or a server token that belongs to the third-party integration rather than the account holder.
  2. Object-level authorisation on the same endpoint. Try supplying an application identifier or user identifier in the request body and see whether the response returns details for an application the caller has not connected. A positive result is application details appearing without a corresponding OAuth grant.
  3. Serialisation of internal records. Compare fields returned to the client with fields shown in the UI. Extra fields such as admin lists, developer UUIDs, redirect URIs, webhook URLs or scope configuration suggest the whole internal object is being serialised, which is where credentials tend to leak.
  4. OAuth-connected third-party apps on other platforms. Repeat the connect-then-read flow on any service that lets users link external applications, and check whether the linked-app listing exposes the partner's credentials. A positive result is a secret or token for the partner application in a response scoped to the linking user.
  5. Token rotation behaviour. Where a secret is exposed, check whether rotating it in the application dashboard invalidates the leaked value, as Uber's documentation describes. A positive result confirms the exposure is directly exploitable rather than a stale value.

Glossary

  • API: a way for one piece of software to ask another for data or an action, like a waiter carrying orders to a kitchen.
  • JSON: a text format for data, made of labelled boxes and lists, used by most web APIs.
  • Endpoint: a specific address on a server that accepts a particular kind of request, such as /api/getAuthorisedApps.
  • POST: an HTTP method used when the browser sends data to the server rather than just asking for a page.
  • HTTP header: an extra line of information sent with a request or response, such as which browser is used or where the request came from.
  • Cookie: a small piece of text a site stores in your browser and receives back with each request, used to recognise your logged-in session.
  • Session: the period during which a site remembers that you are logged in, usually tracked by a cookie.
  • CSRF token: a secret value included in requests from a site's own pages to prove the request came from that site and not from another one.
  • Origin: the scheme, host and port a request comes from, used by servers to decide whether to allow it.
  • Referer: a header saying which page a request came from.
  • User-Agent: a header identifying the browser and operating system that sent a request.
  • OAuth: a standard way for a user to let a third-party app access parts of their account without giving it their password.
  • Scope: a permission an app requests, such as reading ride history or profile details.
  • Client ID: a public identifier for an application on a developer platform.
  • Client secret: the private password of an application, used when it talks to the platform; it must never be shared.
  • Server token: another credential an application uses to call an API from its own servers.
  • UUID: a long, unique identifier used to refer to a user or object internally.
  • Redirect URI: the address an app is allowed to send a user back to after they log in.
  • Webhook URL: an address an app gives so the platform can send it automatic notifications.
  • IP whitelist: a list of network addresses allowed to use something.
  • Information disclosure (information leakage): a bug where a system gives out data it should have kept private.
  • Serialisation: turning an internal record into text so it can be sent over the network; if the whole record is serialised, private fields can go with it.
  • Object-level authorisation: checking that a user may access the specific record they are asking for, not just that they are logged in.
  • Production: the live version of a service that real users use, as opposed to a test environment.
  • Bounty: a payment a company makes to a researcher who reports a security bug responsibly.
  • Responsible disclosure: an agreement that a researcher reports a bug privately and the company gets time to fix it before the details are made public.
  • Secret rotation: replacing a credential with a new one so the old value stops working.

More by Anand Prakash

View all

6 more disclosed reports, best first.

More from Uber

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.