Skip to content
Subdomain takeover Disclosed report Intermediate

Possible SOP bypass in www.starbucks.com due to insecure crossdomain.xml

The crossdomain.xml file allowed many domains, including a wildcard subdomain that was vulnerable to takeover. An attacker could take over that subdomain and host a malicious Flash file to bypass same-origin policy and read sensitive information from starbucks.com.

jackb898 Follow

Originally disclosed on HackerOne

High 7.1 View original
  • Triaged in 25 hours
  • Fixed in 56 days
  • Paid in 15 days
  • Disclosed after 3 months

Summary by the researcher

Ah, my early reports. I've come quite a ways from reporting things before I understood exactly what they were. Nonetheless I got pretty creative here and recognized that a problem existed in this configuration, one that turned out to be a high impact problem. For web developers: always keep your crossdomain.xml allowed domains up to date if you have something other than wildcard allowed! Thank you to the Starbucks team for an efficient and helpful response.

The report

Hello. I was penetration testing your website, and noticed that your crossdomain.xml file allowed many sites access. I went through and, for all the sites that had *.website.com with them, I scanned them for subdomains.

I found that a subdomain for ███████.com (a site in your crossdomain.xml as *███████), m███████, was vulnerable to takeover.

I'm not going to take it over since they do not have a white hat hacker program, but if someone were to take it over, they could make flash files on it to retrieve sensitive information from starbucks.com, and do it with no issue. Another factor that makes it even worse is that it's possible to use any headers also (<allow-http-request-headers-from domain="*" headers="*"/>).

It's similar to if your site had this line in the crossdomain.xml: <allow-access-from domain="*" />

SCENARIO: This is a scenario of how it would most likely be exploited

  1. A black hat is trying to hack into Starbucks
  2. He goes to the crossdomain.xml file looking for <allow-access-from domain="*" />, but he notices lots of different websites are allowed access
  3. He decides to check the domains with *. before them for vulnerable subdomains
  4. He finds m██████, and notices *███████ has access
  5. He takes over m██████ and uploads a malicious flash file to send HTTP requests and see their responses.

HOW TO FIX THIS Pretty simple, obvious fix, but you have two routes you can take for it. First option: You can just remove <allow-access-from domain="*████████" /> from your crossdomain.xml file. (I didn't find any other subdomains vulnerable to takeover that were in there)

Second option: You can talk to ███████, the company that owns █████.com, and tell them to disconnect the DNS records linking m████████ and m██████.███

MORE INFORMATION Here is more information on how it could be exploited: http://resources.infosecinstitute.com/bypassing-csrf-protections-fun-profit/ (read between Abusing CORS via Flash Files down to Bypassing XMLHttpRequest Header Validation)

Thanks, Jack

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

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

Context

The target is www.starbucks.com, and the feature at the centre of the report is the site's crossdomain.xml file, the Flash cross-domain policy that tells the Flash player which remote origins may load data from the host and under what conditions. A permissive policy is not a bug by itself, but it widens the set of origins whose compromise would let an attacker read responses from the protected host.

The report describes the issue as a possible SOP bypass that could be used to retrieve sensitive information from starbucks.com.

Setup

No accounts, roles, tool versions or special tooling are described. The work was manual review of the policy file followed by subdomain enumeration against the domains the policy trusts. The policy listed many domains, several written with a leading wildcard, and one of those domains had a subdomain vulnerable to takeover.

Finding it

While penetration testing the site, the researcher looked at crossdomain.xml and noticed that it allowed many sites access. Rather than stopping at the observation that the list was long, the researcher took every entry written as *.website.com and scanned those domains for subdomains.

That scan turned up a subdomain of a company whose domain appears in the policy in wildcard form. The subdomain was vulnerable to takeover. The researcher redacted the company, the domain and the subdomain throughout the report, so the specific names are not available here.

The reasoning that made this look wrong: a wildcard entry such as *███████ trusts every subdomain of that domain, including ones the owner may have forgotten about. A dangling subdomain that anyone can claim therefore inherits the trust the policy grants to the parent domain.

Exploitation

Step 1: read the policy and note the trusted domains

The researcher inspected crossdomain.xml on www.starbucks.com and found a long list of allowed domains, several of them written with a leading *.. The report does not reproduce the file, so the exact entries are not shown here.

Step 2: enumerate subdomains of the wildcard entries

For each domain listed as *.website.com, the researcher scanned for subdomains. This is the pivot from a configuration observation to an actual weakness: the policy's trust is only as strong as the least controlled host under each wildcard.

Step 3: find a subdomain vulnerable to takeover

One subdomain of the redacted company's domain was found to be vulnerable to takeover. The researcher did not take it over, because the company does not run a white hat hacker programme. The report does not describe the takeover technique or the DNS records involved beyond the fix section below.

Step 4: the exploitation scenario

The report lays out how this would most likely be exploited:

  1. A black hat is trying to hack into Starbucks.
  2. He goes to the crossdomain.xml file looking for <allow-access-from domain="*" />, but notices lots of different websites are allowed access.
  3. He decides to check the domains with *. before them for vulnerable subdomains.
  4. He finds the vulnerable subdomain and notices the wildcard entry has access.
  5. He takes over the subdomain and uploads a malicious Flash file to send HTTP requests and see their responses.

With control of a host the policy trusts, the attacker can serve a Flash file from it. That file is permitted by the policy to make requests to starbucks.com and read the responses, which is exactly what the same-origin policy is meant to prevent for an unrelated origin.

Step 5: the header allowance makes it worse

The report notes a second factor: the policy also permits any request headers, via the following element:

XML
<allow-http-request-headers-from domain="*" headers="*"/>

The report notes the policy also allows any request headers, via the following element: The researcher compares the overall effect to the site having this line in the policy:

XML
<allow-access-from domain="*" />

Root cause

The mistake is a stale, over-broad allow list. The policy grants access to whole domains through wildcard entries, and at least one of those domains had a subdomain that could be claimed by an outsider. The trust relationship is transitive in the wrong direction: the site trusts *.company.com, and control of any single host under company.com is enough to exercise that trust.

The header element compounds it. <allow-http-request-headers-from domain="*" headers="*"/> allows arbitrary request headers from any domain, The header element adds to the problem, since any headers are permitted.. The report does not describe any other defences beyond the policy itself.

Impact

If someone took over the vulnerable subdomain, they could host Flash files on it that retrieve sensitive information from starbucks.com, and do so without obstruction, because the policy authorises the parent domain and its subdomains. The header allowance removes a second restriction on what those requests may carry.

The impact is conditional: it depends on the subdomain remaining available for takeover and on the victim's browser running the Flash content. The researcher did not demonstrate the takeover, only the vulnerable state of the subdomain and the policy that would make it useful.

Fix

The report gives two options.

  1. Remove the wildcard entry for the affected company from crossdomain.xml. The researcher notes that no other subdomains vulnerable to takeover were found among the listed domains.
  2. Contact the company that owns the domain and ask them to disconnect the DNS records linking the vulnerable subdomain to the parent domain.

The broader lesson the researcher draws for web developers is to keep the allowed domains in crossdomain.xml up to date whenever the policy allows something other than a wildcard.

Variants to test

  1. Enumerate every wildcard entry in a crossdomain.xml and run subdomain discovery against each parent domain. A positive result is a subdomain that resolves to a dangling record or an unclaimed service and can be registered or claimed by you.
  2. Look for <allow-http-request-headers-from domain="*" headers="*"/> or similarly broad header elements. A positive result is a policy that lets any origin send arbitrary headers, which widens what a hostile Flash file can do even without a takeover.
  3. Check whether the policy still exists and is served at all. A positive result is a live crossdomain.xml with entries that no longer match the organisation's current infrastructure.
  4. Compare the policy's allow list against the organisation's current domain portfolio. A positive result is an entry for a domain or brand the organisation no longer controls.

Hunting notes

This kind of bug hides in legacy configuration files that nobody revisits: crossdomain.xml, and by extension other cross-domain policy files, tend to outlive the services they were written for. During recon, the signal is a policy that lists named domains rather than a wildcard, especially entries written as *.domain.tld, because each of those is a promise of trust to every host under that domain.

The researcher showed enough impact by connecting three facts the program could verify: the policy trusts the domain, the domain has a subdomain that is vulnerable to takeover, and the policy's header element allows any headers from any origin. The researcher did not take over the subdomain, only reported the vulnerable state and the policy that would make it useful.

A closing note from the researcher: this was an early report, written before a full understanding of the issue, but the configuration problem was real and turned out to have high impact. The Starbucks team's response is described as efficient and helpful.

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

A security researcher was looking at the website www.starbucks.com and found a small configuration file sitting on it called crossdomain.xml. That file is a set of instructions for a piece of software called Flash, which used to run inside web browsers. The file tells Flash which other websites are allowed to talk to starbucks.com and read what comes back.

The problem was that this file listed a lot of other websites as trusted, and some of those entries used a wildcard, written as *.website.com. A wildcard means "every subdomain of this domain", not just the one main address. The researcher scanned those trusted domains for subdomains and found one subdomain that anybody could take over. If an attacker claimed it, they could put a malicious Flash file on it, and because the policy file trusted the parent domain, that file could read private information from starbucks.com.

The researcher did not actually take over the subdomain, because the company that owned it did not have a white hat hacker programme. The report describes the vulnerable subdomain and notes that the policy also allows any request headers.

Background you need first

Before the steps make sense, here are the ideas involved, explained from scratch.

A domain and a subdomain. A domain is a name like example.com. A subdomain is a name in front of it, like shop.example.com or mail.example.com. The owner of example.com controls all of its subdomains, but only as long as they keep track of them. If a subdomain is set up to point at some service and then that service is cancelled, the name can be left pointing at nothing. That is called a dangling record, and sometimes an outsider can register the service and take the name over.

The same-origin policy. Browsers have a rule that a page from one website cannot read data from another website. Think of it like a library where each reader may only open books from their own shelf. Without this rule, any website you visit could quietly read your bank page in another tab. The rule is the reason a random site cannot simply fetch starbucks.com and read the answer.

Flash and crossdomain.xml. Flash was a browser plugin for animations and interactive content. Because the same-origin rule would block Flash content from talking to other sites, Flash introduced a way for a site to opt out: a file named crossdomain.xml placed on the site. In it, the site lists which other origins may load data from it. An origin is a combination of scheme, host and port, roughly "which site and how it was reached". If the file says a domain is allowed, Flash content served from that domain may make requests to the site and read the responses. That is a deliberate hole in the same-origin rule, and it is only as safe as the list of trusted domains.

A wildcard entry. In crossdomain.xml, an entry written as *.website.com trusts every subdomain of website.com. The site owner is effectively saying "any host under this domain is fine". If even one of those hosts can be claimed by a stranger, the stranger inherits that trust.

A takeover. A subdomain takeover happens when a name points at a service that no longer exists, and someone else can sign up for that service and claim the name. The name still belongs to the original owner on paper, but the content served under it is now controlled by the newcomer.

Request headers. When a browser sends a request, it attaches small labelled pieces of information called headers, such as what kind of content it accepts. A policy can restrict which headers a cross-domain request may carry. If it allows all headers from all domains, that restriction disappears.

CSRF and SOP bypass. Cross-site request forgery is when a page you visit makes your browser send a request to another site on your behalf, without you intending it. A same-origin policy bypass is when something gets around the browser's rule about reading other sites' data. The report labels the issue as a possible SOP bypass leading to CSRF-style attacks.

CVSS. A scoring system that rates how serious a vulnerability is. 7.1 is in the high range.

Setting up

The report describes no accounts, roles, tool versions or special tooling. The work was manual: reading the policy file by hand, then scanning the domains it trusts for subdomains. The only precondition is that the policy lists specific domains rather than a single wildcard for everything, and that at least one of those domains has a subdomain that can be taken over.

Finding it

While penetration testing the site, the researcher opened crossdomain.xml and saw that it allowed many sites access. Rather than stopping at "that list is long", they took every entry written in the form *.website.com and scanned those domains for subdomains. The reason for that step is that a wildcard entry is a promise of trust to every host underneath it, so the weakest host under each wildcard is the real question.

The scan found a subdomain of a company whose domain appears in the policy in wildcard form, and that subdomain was vulnerable to takeover. The company, the domain and the subdomain are redacted throughout the report, so the specific names are not available.

The logic that makes this a real problem: a wildcard entry such as *███████ trusts every subdomain of that domain, including ones the owner may have forgotten about. A dangling subdomain that anyone can claim therefore inherits the trust the policy gives to the parent domain.

Exploitation

Step 1: read the policy and note the trusted domains

The researcher inspected crossdomain.xml on www.starbucks.com and found a long list of allowed domains, several written with a leading *.. The report does not reproduce the file, so the exact entries are not shown. The point of this step is to build the list of domains whose subdomains are worth checking.

Step 2: enumerate subdomains of the wildcard entries

For each domain listed as *.website.com, the researcher scanned for subdomains. This is where a configuration observation turns into an actual weakness: the policy's trust is only as strong as the least controlled host under each wildcard. If one host can be claimed by an outsider, the policy's promise now extends to that outsider.

Step 3: find a subdomain vulnerable to takeover

One subdomain of the redacted company's domain was found to be vulnerable to takeover. The researcher did not take it over, because the company does not run a white hat hacker programme. The report does not describe the takeover technique or the DNS records involved beyond the fix section below.

Step 4: the exploitation scenario

The report lays out how this would most likely be exploited:

  1. A black hat is trying to hack into Starbucks.
  2. He goes to the crossdomain.xml file looking for <allow-access-from domain="*" />, but notices lots of different websites are allowed access.
  3. He decides to check the domains with *. before them for vulnerable subdomains.
  4. He finds the vulnerable subdomain and notices the wildcard entry has access.
  5. He takes over the subdomain and uploads a malicious Flash file to send HTTP requests and see their responses.

With control of a host the policy trusts, the attacker can serve a Flash file from it. That file is permitted by the policy to make requests to starbucks.com and read the responses, which is exactly what the same-origin policy is meant to prevent for an unrelated origin. In everyday terms: the library rule says you may only read your own shelf, but the policy file has handed this stranger a library card for the Starbucks shelf.

Step 5: the header allowance makes it worse

The report notes a second factor: the policy also permits any request headers, via the following element:

XML
<allow-http-request-headers-from domain="*" headers="*"/>

Line by line: allow-http-request-headers-from is the instruction that says which request headers are permitted. domain="*" means it applies to every origin, not only the listed domains. headers="*" means any header at all may be sent. The header element adds to the problem, since any headers are permitted.

Because that element uses domain="*", the header allowance applies to any origin. The researcher compares the overall effect to the site having this line in the policy:

XML
<allow-access-from domain="*" />

That line would mean "any website at all may read data from this site", which is the most permissive setting possible. The comparison is there to show how much the combination of a broad allow list and an open header rule gives away.

Root cause

The mistake is a stale, over-broad allow list. The policy grants access to whole domains through wildcard entries, and at least one of those domains had a subdomain that could be claimed by an outsider. The trust relationship runs in the wrong direction: the site trusts *.company.com, and control of any single host under company.com is enough to exercise that trust.

The header element compounds it. <allow-http-request-headers-from domain="*" headers="*"/> allows arbitrary request headers from any domain, so even without a takeover an attacker gains freedom over what headers are sent. The report does not describe any other defences beyond the policy itself.

Impact

If someone took over the vulnerable subdomain, they could host Flash files on it that retrieve sensitive information from starbucks.com, and do so without obstruction, because the policy authorises the parent domain and its subdomains. The header allowance removes a second restriction on what those requests may carry.

The impact is conditional: it depends on the subdomain remaining available for takeover and on the victim's browser running the Flash content. The researcher did not demonstrate the takeover, only the vulnerable state of the subdomain and the policy that would make it useful.

Fix

The report gives two options.

  1. Remove the wildcard entry for the affected company from crossdomain.xml. The researcher notes that no other subdomains vulnerable to takeover were found among the listed domains.
  2. Contact the company that owns the domain and ask them to disconnect the DNS records linking the vulnerable subdomain to the parent domain.

The broader lesson the researcher draws for web developers is to keep the allowed domains in crossdomain.xml up to date whenever the policy allows something other than a wildcard.

Variants to test

  1. Enumerate every wildcard entry in a crossdomain.xml and run subdomain discovery against each parent domain. A positive result is a subdomain that resolves to a dangling record or an unclaimed service and can be registered or claimed by you.
  2. Look for <allow-http-request-headers-from domain="*" headers="*"/> or similarly broad header elements. A positive result is a policy that lets any origin send arbitrary headers, which widens what a hostile Flash file can do even without a takeover.
  3. Check whether the policy still exists and is served at all. A positive result is a live crossdomain.xml with entries that no longer match the organisation's current infrastructure.
  4. Compare the policy's allow list against the organisation's current domain portfolio. A positive result is an entry for a domain or brand the organisation no longer controls.

Hunting notes

This kind of bug hides in legacy configuration files that nobody revisits: crossdomain.xml, and by extension other cross-domain policy files, tend to outlive the services they were written for. During recon, the signal is a policy that lists named domains rather than a wildcard, especially entries written as *.domain.tld, because each of those is a promise of trust to every host under that domain.

The researcher showed enough impact by connecting three facts the program could verify: the policy trusts the domain, the domain has a subdomain that is vulnerable to takeover, and the policy's header element allows any headers from any origin. The researcher did not take over the subdomain, only reported the vulnerable state and the policy that would make it useful.

A closing note from the researcher: this was an early report, written before a full understanding of the issue, but the configuration problem was real and turned out to have high impact. The Starbucks team's response is described as efficient and helpful.

Glossary

  • API: a defined way for one piece of software to ask another for data or actions, like a menu of requests a service accepts.
  • Black hat: an attacker who breaks into systems without permission.
  • Cookie: a small piece of data a website stores in your browser so it can recognise you on later requests.
  • Cross-domain policy: a file that tells a plugin or browser component which other origins may interact with a site.
  • crossdomain.xml: the Flash cross-domain policy file, listing origins allowed to load data from the host.
  • CSRF (cross-site request forgery): tricking your browser into sending a request to another site on your behalf without your intent.
  • CVSS: a scoring system for rating the severity of a vulnerability; 7.1 is high.
  • Dangling record: a DNS entry pointing at a service that no longer exists, which someone else may be able to claim.
  • DNS: the system that maps domain names to the servers behind them.
  • Domain: a name such as example.com that identifies a site on the internet.
  • Flash: an old browser plugin for animations and interactive content, now discontinued.
  • Header: a small labelled piece of information attached to a web request or response, such as the content type.
  • Origin: the combination of scheme, host and port that identifies where content came from.
  • Penetration testing: authorised testing of a system to find security weaknesses.
  • Same-origin policy: the browser rule that a page from one origin cannot read data from another origin.
  • SOP bypass: a way around the same-origin policy.
  • Subdomain: a name in front of a domain, such as shop.example.com.
  • Subdomain takeover: claiming a subdomain whose original service has gone away, so that content under that name is now yours.
  • White hat hacker programme: a scheme where a company invites researchers to report vulnerabilities, often with rewards or protection.
  • Wildcard: a * character meaning "anything", so *.example.com means every subdomain of example.com.

More by jackb898

View all

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