Skip to content
Subdomain takeover Write-up Intermediate

Subdomain takeover Starbucks (Part 2)

A Starbucks subdomain had a CNAME pointing to an Azure Traffic Manager endpoint that no longer existed, allowing anyone to register that endpoint and take over the subdomain. An attacker could then serve their own content on the Starbucks subdomain.

Patrik Hudak Follow

Published on 0xpatrik.com

Bounty$2,000 View original

Recently, I was repeatedly awarded $2,000 bounty for subdomain takeover on Starbucks. You may remember my post about bug bounty report where I described how to subdomain takeover was possible using Azure.

Patrik Hudak, on 0xpatrik.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. 5 min read.

Context

Starbucks runs a bug bounty programme on HackerOne, and this write-up covers a subdomain takeover that was awarded a $2,000 bounty. The target was wfmnarptpc.starbucks.com, a hostname under the Starbucks domain that pointed, via CNAME, at an Azure Traffic Manager endpoint. Traffic Manager is the Azure service that distributes user traffic across service endpoints in different datacentres, and it can also front external, non-Azure endpoints. The feature that made the takeover possible is the way Traffic Manager names its endpoints: a profile gets a DNS name under trafficmanager.net, and if that profile is deleted while a CNAME elsewhere still points at it, the name becomes available for anyone to claim.

This case is close to an earlier Starbucks takeover the author had published, which used Azure directly. Here the dangling record pointed at Traffic Manager instead, so the proof of concept had to be built with that service.

Report
Report From the original on 0xpatrik.com

Setup

The researcher needed a DNS resolver to inspect the record, an Azure account to create a Traffic Manager profile, and a server he controlled to receive the traffic. The report does not give Azure subscription details, tool versions beyond the dig banner shown below, or the server software version. The precondition for the whole attack is a CNAME in the target's DNS that points at a trafficmanager.net name which no longer exists.

Finding it

On a Monday evening the author noticed that wfmnarptpc.starbucks.com answered with NXDOMAIN. The more interesting part was the CNAME: the name was aliased to s00149tmppcrpt.trafficmanager.net. From experience he knew this had a strong chance of being a subdomain takeover. Azure mostly uses dedicated IP addresses, so when a CNAME to Azure resolves to NXDOMAIN, that is the signal to look closer.

He also notes that trafficmanager.net is one of the domains where subdomain takeover is possible, alongside the Azure targets covered previously. The confirmation came from a dig query:

Bash
$ dig a wfmnarptpc.starbucks.com

; <<>> DiG 9.10.6 <<>> a wfmnarptpc.starbucks.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 20251
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;wfmnarptpc.starbucks.com.	IN	A

;; ANSWER SECTION:
wfmnarptpc.starbucks.com. 33165	IN	CNAME	s00149tmppcrpt.trafficmanager.net.

The status is NXDOMAIN and the answer section holds only the CNAME, with no address record behind it. In plain terms, a live domain points at a non-existent subdomain of trafficmanager.net. Because Azure does not perform any domain ownership verification when a profile is created, whoever registers that name first controls what the CNAME resolves to.

There is a caveat the author stresses from his earlier work on takeover basics: a dangling CNAME is not yet the winning point. The name may still exist in Azure with a disabled configuration. In that situation the takeover looks possible from the outside, but the proof of concept will fail because the name cannot be claimed. The only way to know is to try to create it.

Exploitation

Step 1: create a Traffic Manager profile

He started by creating a new Traffic Manager profile in the Azure portal.

Traffic Manager profile creation
Traffic Manager profile creation From the original on 0xpatrik.com

The profile creation succeeded, which meant s00149tmppcrpt.trafficmanager.net was available. That is the decisive check: the name could be taken, so the proof of concept could proceed. The screenshot accompanies the profile creation step.

Step 2: point the endpoint at a server he owned

With the name claimed, the next step was to make the profile send traffic to infrastructure under his control. He added an endpoint to the profile that pointed at one of his own servers.

Traffic Manager endpoint creation
Traffic Manager endpoint creation From the original on 0xpatrik.com

The screenshot accompanies the endpoint step.

Step 3: serve the hostname on that server

The last piece was a virtual host on his endpoint, so that requests arriving with the Starbucks hostname would be answered by his content rather than a default site.

VHost Starbucks
VHost Starbucks From the original on 0xpatrik.com

The screenshot accompanies the virtual host step. With the profile claimed, the endpoint pointing at his server and the virtual host in place, a request to wfmnarptpc.starbucks.com was served from his infrastructure.

Subdomain takeover PoC
Subdomain takeover PoC From the original on 0xpatrik.com

The final screenshot accompanies the completed proof of concept.

Root cause

The mistake is a stale DNS record. wfmnarptpc.starbucks.com kept a CNAME to s00149tmppcrpt.trafficmanager.net after the corresponding Traffic Manager profile had been removed, leaving the name free for anyone to register. Azure does not verify domain ownership when a Traffic Manager profile is created, so the first person to claim the name inherits all traffic addressed to the Starbucks hostname. The CNAME was left in place after the Traffic Manager profile was removed. The author's earlier caveat applies here too: a dangling CNAME alone does not prove takeover, because the name might still be held by a disabled configuration; only a successful profile creation confirms it.

Impact

An attacker who claims the dangling name controls the content served on the Starbucks subdomain. The report does not describe specific abuse beyond the proof of concept, and the impact depends on where the hostname is used: any link, cookie scope or trust relationship tied to that subdomain would then point at attacker-controlled content. The bounty was $2,000.

Fix

The fix implied by the root cause is to remove the CNAME for wfmnarptpc.starbucks.com (or repoint it at a resource that still exists) whenever the corresponding Traffic Manager profile is deleted, and to audit DNS for other records pointing at decommissioned Azure resources.

Variants to test

  1. Enumerate CNAMEs under a target domain and resolve each one. A positive result is a CNAME to a cloud service name that returns NXDOMAIN, as with s00149tmppcrpt.trafficmanager.net here.
  2. Check trafficmanager.net names specifically, not just the Azure services covered in earlier write-ups. A positive result is a profile name that can be created in the Azure portal without any ownership verification.
  3. Treat a dangling CNAME as a lead, not a finding, and attempt to claim the name. A positive result is successful creation of the resource, which distinguishes a real takeover from a disabled configuration that only looks vulnerable from outside.
  4. After claiming the name, point the endpoint at a server you control and add a virtual host for the target hostname. A positive result is the target subdomain serving your content.

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

What happened, in plain words

Starbucks, the coffee company, runs a bug bounty programme on a website called HackerOne. A bug bounty programme is a deal: a company says "if you find a security problem in our systems and tell us about it responsibly, we will pay you a reward". The reward is called a bounty. This write-up is the story of one such finding, and it earned the researcher $2,000.

The problem he found is called a subdomain takeover. To understand it, you first need to know what a subdomain is. A domain is a name on the internet, like starbucks.com. A subdomain is a name that sits in front of it, like shop.starbucks.com or wfmnarptpc.starbucks.com. Companies use subdomains for all sorts of things: a shop, a help centre, a marketing campaign, an internal tool. Each subdomain is a separate name that the company controls.

Now, a subdomain does not usually point at a server directly. It points at another name, using a record called a CNAME. Think of a CNAME as a forwarding note on a door: "this address has moved, please go to this other address instead". When you type the subdomain into your browser, the internet's address book (called DNS, the Domain Name System) reads the forwarding note and sends you to wherever it points.

The danger comes when the forwarding note points at something that no longer exists. If the company deletes the thing the note points at, but forgets to delete the note itself, the note is left dangling. Anyone who can recreate the thing at the other end can then claim it, and all traffic for the company's subdomain will flow to them. That is a subdomain takeover.

In this case, the thing at the other end was a service from Microsoft called Azure Traffic Manager. Azure is Microsoft's cloud platform: a collection of rented computers and services that anyone can sign up for. Traffic Manager is one of those services. Its job is to spread incoming traffic across several servers in different places, so that if one place has a problem, the others keep working. It can also point at servers that are not in Azure at all.

Report
Report From the original on 0xpatrik.com

The key detail is how Traffic Manager names things. When you create a Traffic Manager profile (a profile is just a named configuration), Azure gives it a name under trafficmanager.net. If that profile is later deleted, the name becomes free again. And Azure does not check whether you own the domain that points at it. So if a company's subdomain still has a CNAME pointing at a Traffic Manager name that has been deleted, the first person to create a profile with that name takes control of the company's subdomain.

This case is very similar to an earlier Starbucks takeover the same researcher had written about, which used Azure directly. Here, the dangling record pointed at Traffic Manager instead, so the proof of concept had to be built with that service.

Setup

To reproduce this, the researcher needed three things:

  1. A way to look up DNS records, so he could inspect the CNAME. He used a command-line tool called dig, which asks a DNS server a question and prints the answer.
  2. An Azure account, so he could create a Traffic Manager profile and try to claim the free name.
  3. A server he controlled, so that once the name was claimed, he could point it at his own machine and show content there.

The report does not give Azure subscription details, tool versions beyond the dig banner shown below, or the server software version. The precondition for the whole attack is a CNAME in the target's DNS that points at a trafficmanager.net name which no longer exists.

Finding it

On a Monday evening, the author noticed that wfmnarptpc.starbucks.com answered with NXDOMAIN. NXDOMAIN is DNS shorthand for "no such domain": the address book was asked about the name and replied that it does not exist. That alone is not unusual; plenty of names do not exist. The interesting part was the CNAME: the name was aliased to s00149tmppcrpt.trafficmanager.net.

From experience, he knew this had a strong chance of being a subdomain takeover. Azure mostly uses dedicated IP addresses, so when a CNAME to Azure resolves to NXDOMAIN, that is the signal to look closer. In other words, a name that is supposed to be handled by Azure is reporting that it does not exist, which suggests the Azure side has been deleted while the forwarding note remains.

He also notes that trafficmanager.net is one of the domains where subdomain takeover is possible, alongside the Azure targets covered previously. The confirmation came from a dig query:

Bash
$ dig a wfmnarptpc.starbucks.com

; <<>> DiG 9.10.6 <<>> a wfmnarptpc.starbucks.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 20251
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;wfmnarptpc.starbucks.com.	IN	A

;; ANSWER SECTION:
wfmnarptpc.starbucks.com. 33165	IN	CNAME	s00149tmppcrpt.trafficmanager.net.

Line by line, in plain words:

  • $ dig a wfmnarptpc.starbucks.com is the command. The $ is just the shell prompt. dig is the lookup tool, a means "I am asking for an A record", and an A record is the DNS record that maps a name to an IP address (the numeric address of a server). The name being asked about is the Starbucks subdomain.
  • The lines starting with ; are comments printed by dig itself. They are not part of the answer; they are context.
  • DiG 9.10.6 is the version of the tool that ran the query.
  • opcode: QUERY says this was a question, not an update. status: NXDOMAIN is the important part: the DNS server said the name does not exist. id: 20251 is just a number used to match the question with the answer.
  • flags: qr rd ra are small status markers. qr means this is a response, rd means recursion was requested (the server should go and find the answer for you), and ra means recursion was available.
  • QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1 counts how many records appear in each section of the reply. There is one question, zero answers, one authority record and one additional record.
  • The OPT PSEUDOSECTION block is technical metadata about the query itself, including the maximum reply size (udp: 4096). It is not part of the answer.
  • The QUESTION SECTION repeats what was asked: an A record for wfmnarptpc.starbucks.com.
  • The ANSWER SECTION is the actual reply. It contains one line: wfmnarptpc.starbucks.com. 33165 IN CNAME s00149tmppcrpt.trafficmanager.net. This says the Starbucks name is a CNAME (a forwarding note) pointing at s00149tmppcrpt.trafficmanager.net. The 33165 is how many seconds the answer may be cached, and IN is the class of record (internet).

So the status is NXDOMAIN and the answer section holds only the CNAME, with no address record behind it. In plain terms, a live domain points at a non-existent subdomain of trafficmanager.net. Because Azure does not perform any domain ownership verification when a profile is created, whoever registers that name first controls what the CNAME resolves to.

There is a caveat the author stresses from his earlier work on takeover basics: a dangling CNAME is not yet the winning point. The name may still exist in Azure with a disabled configuration. In that situation the takeover looks possible from the outside, but the proof of concept will fail because the name cannot be claimed. The only way to know is to try to create it.

Exploitation

Step 1: create a Traffic Manager profile

He started by creating a new Traffic Manager profile in the Azure portal. The Azure portal is the website where you manage your Azure account; it is a normal web page with forms and buttons.

Traffic Manager profile creation
Traffic Manager profile creation From the original on 0xpatrik.com

The profile creation succeeded, which meant s00149tmppcrpt.trafficmanager.net was available. That is the decisive check: the name could be taken, so the proof of concept could proceed. The screenshot accompanies the profile creation step.

Why this step matters: the whole attack depends on whether the name is free. If Azure had refused because the name was already in use, the finding would have been a false alarm. By successfully creating the profile, he turned a suspicion into a confirmed takeover.

Step 2: point the endpoint at a server he owned

With the name claimed, the next step was to make the profile send traffic to infrastructure under his control. He added an endpoint to the profile that pointed at one of his own servers. An endpoint, in Traffic Manager terms, is simply a destination: the place where traffic should be sent.

Traffic Manager endpoint creation
Traffic Manager endpoint creation From the original on 0xpatrik.com

The screenshot accompanies the endpoint step.

Why this step matters: claiming the name only means the forwarding note now leads to a profile he controls. To actually serve something, that profile has to forward visitors to a machine he can put content on. Pointing the endpoint at his own server closes that gap.

Step 3: serve the hostname on that server

The last piece was a virtual host on his endpoint, so that requests arriving with the Starbucks hostname would be answered by his content rather than a default site. A virtual host is a setting on a web server that says "when a request arrives asking for this particular name, serve this particular content". One server can host many names this way, which is why it is called virtual: the names are separated in software, not by separate machines.

VHost Starbucks
VHost Starbucks From the original on 0xpatrik.com

The screenshot accompanies the virtual host step. With the profile claimed, the endpoint pointing at his server and the virtual host in place, a request to wfmnarptpc.starbucks.com was served from his infrastructure.

Subdomain takeover PoC
Subdomain takeover PoC From the original on 0xpatrik.com

The final screenshot accompanies the completed proof of concept.

Why this step matters: without the virtual host, his server would not know which site to show for the Starbucks name. With it, the browser asking for the Starbucks subdomain gets his page, which is the visible proof that the takeover works.

Root cause

The mistake is a stale DNS record. wfmnarptpc.starbucks.com kept a CNAME to s00149tmppcrpt.trafficmanager.net after the corresponding Traffic Manager profile had been removed, leaving the name free for anyone to register. Azure does not verify domain ownership when a Traffic Manager profile is created, so the first person to claim the name inherits all traffic addressed to the Starbucks hostname. The CNAME was left in place after the Traffic Manager profile was removed. The author's earlier caveat applies here too: a dangling CNAME alone does not prove takeover, because the name might still be held by a disabled configuration; only a successful profile creation confirms it.

Impact

An attacker who claims the dangling name controls the content served on the Starbucks subdomain. The report does not describe specific abuse beyond the proof of concept, and the impact depends on where the hostname is used: any link, cookie scope or trust relationship tied to that subdomain would then point at attacker-controlled content. The bounty was $2,000.

A cookie, in case the term is new, is a small piece of data a website stores in your browser so it can recognise you on later visits. The report does not go into this in detail; it simply notes that the impact depends on how the hostname is used.

Fix

The fix implied by the root cause is to remove the CNAME for wfmnarptpc.starbucks.com (or repoint it at a resource that still exists) whenever the corresponding Traffic Manager profile is deleted, and to audit DNS for other records pointing at decommissioned Azure resources.

Variants to test

  1. Enumerate CNAMEs under a target domain and resolve each one. A positive result is a CNAME to a cloud service name that returns NXDOMAIN, as with s00149tmppcrpt.trafficmanager.net here.
  2. Check trafficmanager.net names specifically, not just the Azure services covered in earlier write-ups. A positive result is a profile name that can be created in the Azure portal without any ownership verification.
  3. Treat a dangling CNAME as a lead, not a finding, and attempt to claim the name. A positive result is successful creation of the resource, which distinguishes a real takeover from a disabled configuration that only looks vulnerable from outside.
  4. After claiming the name, point the endpoint at a server you control and add a virtual host for the target hostname. A positive result is the target subdomain serving your content.

Glossary

  • Bug bounty programme: a scheme where a company pays people for responsibly reporting security problems in its systems.
  • Bounty: the reward paid for a valid report.
  • HackerOne: the platform where the Starbucks programme and this report were hosted.
  • Domain: a name on the internet, such as starbucks.com.
  • Subdomain: a name in front of a domain, such as wfmnarptpc.starbucks.com.
  • DNS: the internet's address book, which turns names into addresses and other records.
  • CNAME: a DNS record that says "this name is an alias for that other name".
  • Dangling CNAME: a CNAME pointing at a name that no longer exists.
  • Subdomain takeover: claiming a name that a company's DNS still points at, so that the company's subdomain serves your content.
  • NXDOMAIN: the DNS reply meaning "no such domain".
  • A record: a DNS record that maps a name to an IP address.
  • IP address: the numeric address of a machine on a network.
  • dig: a command-line tool for asking DNS servers questions.
  • Azure: Microsoft's cloud platform, a collection of rented computing services.
  • Traffic Manager: an Azure service that spreads traffic across several endpoints in different places.
  • Profile: a named configuration in Azure; here, the Traffic Manager setup that owns a trafficmanager.net name.
  • Endpoint: a destination that Traffic Manager sends traffic to.
  • Azure portal: the website where an Azure account is managed.
  • Virtual host: a web server setting that serves different content depending on which name the request asked for.
  • Proof of concept (PoC): a demonstration that a suspected problem can actually be exploited.
  • Cookie: a small piece of data a website stores in your browser to recognise you later.
  • Remediation: the fix a company applies after a report.

More by Patrik Hudak

View all

2 more disclosed reports, best first.

More from Starbucks

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.