Skip to content
Subdomain takeover Write-up Intermediate

Reading Uber’s Internal Emails [Uber Bug Bounty report worth $10,000]

Rojan Rijal Follow

Published on web.archive.org

Bounty$10,000 View original

After recent finding about one of the Uber’s subdomain takeover was publicly disclosed, I looked into Uber to find similar bugs. One of my colleagues Abhibandu Kafle, pointed out that em.uber.com also had CNAME pointing to SendGrid and could be vulnerable to similar kind of issue.

Rojan Rijal (@uraniumhacker), on web.archive.org

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

Context

Uber used SendGrid as its transactional and marketing email service. Some Uber subdomains were configured with DNS records pointing at SendGrid, and the researcher's colleague Abhibandu Kafle had noticed that em.uber.com had a CNAME pointing to SendGrid, making it a candidate for the same class of subdomain takeover issue that had recently been disclosed against another Uber subdomain.

The feature at the centre of the report is SendGrid's Inbound Parse Webhook, described in the report as "a medium for email interception". It lets an account owner register a domain so that mail arriving for that domain is delivered to a webhook receiver as HTTP POST requests. SendGrid also offers a "white-label" option, which allows emails to be sent through a verified domain.

Setup

  1. The researcher signed up for a SendGrid account to see what was possible.
  2. He ran a Python web application, adapted from a program written by SendGrid for use with the inbound parse webhook, modified so that it would display received emails in his terminal. The application set up a local HTTP server on port 5000.
  3. He used ngrok to tunnel that local server to a public web address, so that Inbound Parse had a receiver domain to send POST requests to.

No versions, credentials or specific configuration values are given in the report.

Finding it

The starting hypothesis was that em.uber.com could be claimed through SendGrid in the same way as the previously disclosed subdomain takeover. The researcher had limited experience with SendGrid, so he initially focused on other issues and only came back to it later, when he was running out of endpoints to look into.

Looking around SendGrid to understand how a domain could be claimed, he found that he could not edit the contents of the domain, as would normally be done to demonstrate a subdomain hijacking, because that was not possible through SendGrid. The "white-label" option, which allows emails to be sent through a verified domain, caught his eye.

A second observation came by accident. Having forgotten his Uber account password, he reset it and noticed that the reset email Uber sent had its reply email set to @em.uber.com. That told him the MX record for em.uber.com was being used somehow. A lookup through dnsgoodies.com showed the MX record pointing to mx.sendgrid.net.

image
image From the original on web.archive.org

With the MX record confirmed, he researched SendGrid's workflow further and realised that em.uber.com could be claimed in the Inbound Parse Webhook, which was not yet claimed by Uber. That became the focus.

Exploitation

Step 1: Prepare a receiver

He located a Python program written by SendGrid for use with the inbound parse webhook and tweaked it so that it would display the emails in his terminal. Running the application started a local HTTP server on port 5000, and ngrok tunnelled it to a web address that Inbound Parse could POST to.

Step 2: Claim the domain in Inbound Parse

He added em.uber.com as a domain in the Inbound Parse Webhook configuration, pointing it at the ngrok receiver. The report does not reproduce the configuration request or the exact values entered.

Step 3: Receive mail

Soon he was able to receive emails addressed to em.uber.com. The same held for all of Uber's subdomains, one of which was www.uber.com. That hostname was also used in Uber's Sentry (a crash reporter) plugin, so the claim allowed him to receive Sentry logs from www.uber.com, because they were sent as email.

image
image From the original on web.archive.org

The image shows the list of domains he was able to add in the webhook. The proof-of-concept video submitted with the bug report is referenced in the report but not reproduced here.

Root cause

A DNS record for an Uber subdomain pointed at SendGrid, but the domain had not been claimed in SendGrid's Inbound Parse Webhook. SendGrid's Inbound Parse Webhook allowed any account to register a domain for mail delivery without proving ownership of it, so whoever registered the domain first received the mail. The report notes that SendGrid later added extra verification forcing a verified domain before an inbound parse webhook can be added, which is consistent with the absence of such a check at the time.

Impact

An attacker who claimed a domain in Inbound Parse received the email sent to that domain. In this case that included email addressed to em.uber.com and Sentry crash-report logs from www.uber.com, which the researcher describes as a significant information disclosure for Uber. The report does not enumerate which other subdomains were affected beyond stating that the technique worked with all of Uber's subdomains.

Fix

Uber fixed the vulnerability quickly and told the researcher that it had also contacted SendGrid to see what could be done. SendGrid's stated position was that the best option is for companies to claim the domain on their side. About 10 days after the bug was resolved, Uber awarded a $10,000 bounty.

At the time of writing, SendGrid had added extra verification that forces a verified domain before an inbound parse webhook can be added.

Variants to test

  1. Enumerate subdomains with CNAME or MX records pointing at a third-party email or webhook provider, then check whether the corresponding domain is claimed in that provider's console. A positive result is the ability to register the domain and receive mail or webhook traffic addressed to it.
  2. Check whether a provider's inbound parse or webhook feature requires domain verification before a domain can be added. A positive result is being able to add a domain you do not control.
  3. Look for reply-to or bounce addresses on transactional email that use a subdomain you have not seen before, then resolve its MX record. A positive result is an MX record pointing at a provider where the domain is unclaimed.
  4. Check whether crash-reporting or logging integrations send data by email to a subdomain. A positive result is receiving those logs at your receiver after claiming the domain.

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

What happened, in plain words

A security researcher found that he could receive emails addressed to an Uber subdomain by claiming it at its email provider. The domain was em.uber.com, and the provider was SendGrid, a service that companies use to send and receive large amounts of email. Because Uber had pointed a DNS record for em.uber.com at SendGrid but had not claimed the domain in SendGrid's Inbound Parse Webhook, anyone with a SendGrid account could register it first and start receiving the mail. The researcher did exactly that, and also received crash reports from www.uber.com. Uber fixed it quickly and paid a $10,000 bounty.

This article explains the whole story from scratch, assuming you only know how to use a browser. Every technical term is explained the first time it appears.

Background: what is a subdomain, a DNS record, and a subdomain takeover?

A domain is a name like uber.com. A subdomain is a name in front of it, like em.uber.com or www.uber.com. Companies use subdomains for different services: www for the website, em for email, and so on.

DNS (Domain Name System) is the internet's address book. When your browser or mail server needs to find where em.uber.com lives, it asks DNS. DNS answers with different types of records:

  • An A record gives an IP address (the numeric address of a server).
  • A CNAME record says "this name is an alias for that other name". For example, em.uber.com might be a CNAME pointing to a SendGrid hostname.
  • An MX record says which mail server should receive email for that domain.

A subdomain takeover happens when a company points a DNS record at an external service (like SendGrid, GitHub Pages, or Heroku) but never claims the corresponding name inside that service. The external service then lets anyone else claim it. The attacker does not break any password; they simply register a name that is already pointing at them.

Uber had recently had a subdomain takeover disclosed publicly, and the researcher's colleague Abhibandu Kafle noticed that em.uber.com had a CNAME pointing to SendGrid, making it a candidate for the same kind of issue.

The feature at the centre: SendGrid's Inbound Parse Webhook

SendGrid is a transactional and marketing email service: companies use it to send receipts, password resets, and marketing mail. It also has a feature for receiving mail.

The Inbound Parse Webhook lets an account owner register a domain so that mail arriving for that domain is delivered to a webhook receiver as HTTP POST requests. Two terms there:

  • A webhook is a way for one service to notify another automatically. Think of it as a doorbell: when something happens (an email arrives), SendGrid rings a URL you gave it, and delivers the data.
  • An HTTP POST request is one of the standard ways a browser or program sends data to a server. When you submit a login form, your browser sends a POST request.

So Inbound Parse is a forwarding service: email comes in, SendGrid turns it into an HTTP POST, and sends it to a URL you control. The report calls it "a medium for email interception".

SendGrid also offers a white-label option, which allows emails to be sent through a verified domain. The researcher looked at it, but it was not the path he used.

Setting up a receiver

To receive the POST requests, the researcher needed a server on the internet that could accept them. He did not own a public server, so he used two tools:

  1. He signed up for a SendGrid account to see what was possible.
  2. He ran a Python web application. Python is a programming language; a web application is a program that listens for HTTP requests. He adapted a program written by SendGrid for use with the inbound parse webhook, modified so that it would display received emails in his terminal. The application set up a local HTTP server on port 5000. A port is like a numbered door on a computer; port 5000 is simply the door the program listened on.
  3. He used ngrok to tunnel that local server to a public web address. A tunnel makes a program running on your own computer reachable from the internet. ngrok gives you a public URL that forwards traffic to your local port. This was needed so that Inbound Parse had a receiver domain to send POST requests to.

The report gives no versions, credentials or specific configuration values.

Finding it

The starting hypothesis was that em.uber.com could be claimed through SendGrid in the same way as the previously disclosed subdomain takeover. The researcher had limited experience with SendGrid, so he initially focused on other issues and only came back to it later, when he was running out of endpoints to look into. An endpoint here means a part of a website or API that accepts requests; running out of them means he had tested most of the obvious places.

Looking around SendGrid to understand how a domain could be claimed, he found that he could not edit the contents of the domain, as would normally be done to demonstrate a subdomain hijacking, because that was not possible through SendGrid. The white-label option caught his eye, but it was not the path he used.

A second observation came by accident. Having forgotten his Uber account password, he reset it and noticed that the reset email Uber sent had its reply email set to @em.uber.com. That told him the MX record for em.uber.com was being used somehow. A lookup through dnsgoodies.com showed the MX record pointing to mx.sendgrid.net.

image
image From the original on web.archive.org

The lookup showed the MX record for em.uber.com pointing at mx.sendgrid.net, SendGrid's mail server. That confirmed that mail for em.uber.com was being handled by SendGrid.

With the MX record confirmed, he researched SendGrid's workflow further and realised that em.uber.com could be claimed in the Inbound Parse Webhook, which was not yet claimed by Uber. That became the focus.

Exploitation

Step 1: Prepare a receiver

He located a Python program written by SendGrid for use with the inbound parse webhook and tweaked it so that it would display the emails in his terminal. Running the application started a local HTTP server on port 5000, and ngrok tunnelled it to a web address that Inbound Parse could POST to.

Step 2: Claim the domain in Inbound Parse

He added em.uber.com as a domain in the Inbound Parse Webhook configuration, pointing it at the ngrok receiver. The report does not reproduce the configuration request or the exact values entered.

Step 3: Receive mail

Soon he was able to receive emails addressed to em.uber.com. The same held for all of Uber's subdomains, one of which was www.uber.com. That hostname was also used in Uber's Sentry plugin. Sentry is a crash reporter: it collects errors from applications. www.uber.com was also used in Uber's Sentry plugin, and because those logs were sent as email, claiming the domain allowed him to receive Sentry logs from www.uber.com.

image
image From the original on web.archive.org

The image shows the list of domains he was able to add in the webhook. The proof-of-concept video submitted with the bug report is referenced in the report but not reproduced here.

Root cause

A DNS record for an Uber subdomain pointed at SendGrid, but the corresponding domain had not been claimed in the SendGrid account that Uber controlled. SendGrid's Inbound Parse Webhook allowed any account to register a domain for mail delivery without proving ownership of it, so whoever registered the domain first received the mail. The report notes that SendGrid later added extra verification forcing a verified domain before an inbound parse webhook can be added, which is consistent with the absence of such a check at the time.

Impact

An attacker who claimed a domain in Inbound Parse received the email sent to that domain. In this case that included email addressed to em.uber.com and Sentry crash-report logs from www.uber.com, which the researcher describes as a significant information disclosure for Uber. The report does not enumerate which other subdomains were affected beyond stating that the technique worked with all of Uber's subdomains.

Fix

Uber fixed the vulnerability quickly and told the researcher that it had also contacted SendGrid to see what could be done. SendGrid's stated position was that the best option is for companies to claim the domain on their side. About 10 days after the bug was resolved, Uber awarded a $10,000 bounty.

At the time of writing, SendGrid had added extra verification that forces a verified domain before an inbound parse webhook can be added.

Variants to test

  1. Enumerate subdomains with CNAME or MX records pointing at a third-party email or webhook provider, then check whether the corresponding domain is claimed in that provider's console. A positive result is the ability to register the domain and receive mail or webhook traffic addressed to it.
  2. Check whether a provider's inbound parse or webhook feature requires domain verification before a domain can be added. A positive result is being able to add a domain you do not control.
  3. Look for reply-to or bounce addresses on transactional email that use a subdomain you have not seen before, then resolve its MX record. A positive result is an MX record pointing at a provider where the domain is unclaimed.
  4. Check whether crash-reporting or logging integrations send data by email to a subdomain. A positive result is receiving those logs at your receiver after claiming the domain.

Glossary

  • Domain: a name like uber.com that identifies a website or email service.
  • Subdomain: a name in front of a domain, like em.uber.com.
  • DNS: the internet's address book, which maps names to servers.
  • DNS record: an entry in DNS, such as an A, CNAME, or MX record.
  • A record: a DNS record that gives an IP address.
  • CNAME record: a DNS record that says one name is an alias for another.
  • MX record: a DNS record that says which mail server receives email for a domain.
  • Subdomain takeover: registering a name at an external service that a company pointed DNS at but never claimed.
  • SendGrid: a service for sending and receiving email.
  • Inbound Parse Webhook: a SendGrid feature that forwards incoming email to a URL as HTTP POST requests.
  • Webhook: an automatic notification from one service to another, usually an HTTP request to a URL.
  • HTTP POST request: a standard way for a program to send data to a server.
  • Python: a programming language.
  • Port: a numbered door on a computer that a program listens on.
  • ngrok: a tool that makes a local server reachable from the internet through a public URL.
  • Tunnel: a forwarding path from a public address to a local program.
  • Endpoint: a part of a website or API that accepts requests.
  • Sentry: a crash-reporting service that collects errors from applications.
  • Information disclosure: a bug where data that should be private is exposed.
  • Bounty: a reward paid by a company for a valid security report.

More by Rojan Rijal

View all

20 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.

Subdomain takeover

The lesson behind this report.

A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.