Hacking — Always Check the Cross-domain Policy
Starbucks' cross-domain policy allowed access from a domain that the researcher could take over via a subdomain takeover. An attacker could then use a Flash file to bypass the Same Origin Policy and steal session cookies.
My report: https://hackerone.com/reports/244504
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.
Context
This write-up is about a configuration problem rather than a bug in application code: a permissive cross-domain policy file served from the root of a site. The file is crossdomain.xml, and it tells Adobe Flash which foreign origins are allowed to load resources from the site. Any domain listed inside an <allow-access-from> tag in that policy can use Flash files to read resources that would normally only be reachable by the origin site itself.
The target was Starbucks, and the researcher's report was filed on HackerOne (report 244504) and paid a bounty of 750.00 USD. The weakness is described as a Same Origin Policy bypass leading to CSRF. The researcher is candid that at the time of discovery they understood the configuration problem but not all of the technicalities behind it, and learned the details more thoroughly after reporting.
Setup
No special accounts, roles or tooling are described. The precondition is simply that the target serves a crossdomain.xml at its root, and that the domains listed in it include a wildcard for a domain on which the researcher can obtain a subdomain. The researcher's general approach when starting penetration testing was to check out configurations, and this file was one of the configurations they looked at.
Finding it
The researcher learned about a file on the root directory of many websites called crossdomain.xml. Domains contained within <allow-access-from> tags in this policy can use Flash files to access resources that are typically only accessible by the origin site. Twitter's policy is given as an example of a secure configuration: it only allows access from *.twitter.com domains, because resources such as session cookies should not be shared with any other website, or the victim's account could be compromised with CSRF alone.

The image is used to illustrate Twitter as a good example of a secure cross-domain policy.
In Starbucks' case, the file contained many different domains, one of them being *.example.com (the researcher substitutes this name for confidentiality; the actual domain is described as an irrelevant detail). That wildcard is what made the configuration interesting: if any subdomain of that domain could be taken over, the attacker would own an origin that the policy trusts.
Exploitation
Step 1: Read the cross-domain policy
Request the policy from the root of the target:
The policy contained many different domains inside <allow-access-from> tags, one of them a wildcard written as *.example.com.
Step 2: Take over a subdomain of a trusted domain
The researcher found that a subdomain of example.com could be taken over. That gives the attacker ownership of an origin that appears inside Starbucks' cross-domain policy. The report does not describe the takeover technique or the specific subdomain.
Step 3: Use Flash to read cross-origin responses
With ownership of a trusted subdomain, the attacker performs CSRF to retrieve sensitive data such as session cookies. This involves making a Flash file that sends an HTTP request to a domain holding the sensitive information, and then logging the response. Because the requesting origin is included in the cross-domain policy, the response, including the sensitive cookies, is readable by the Flash file. The report does not include the Flash source or the request it sends.
Root cause
The mistake is in the design of the cross-domain policy: it trusts a wildcard for a domain whose subdomains are not all under the organisation's control. The policy is meant to restrict Flash cross-origin reads to the organisation's own origins, as in Twitter's *.twitter.com example, but a wildcard over a domain with a takeoverable subdomain extends that trust to an attacker-controlled origin. The Same Origin Policy is then bypassed for that origin, and the usual protection against reading another site's responses no longer applies.
One important limit: if the policy is a full wildcard for any domain, in the form <allow-access-from domain="*" />, the site likely has other security measures in place preventing CSRF and SOP bypass, and the finding is not relevant. The issue here depends on the wildcard being scoped to a specific domain that has a takeoverable subdomain, not on a blanket wildcard.
Impact
An attacker who owns a subdomain listed in the policy can read responses from the target that would otherwise be restricted to the origin site. In the researcher's description this is used to retrieve sensitive data such as session cookies, which can lead to compromise of the victim's account. The attack requires a subdomain takeover on a domain that appears in the policy. The report does not quantify how many users or which specific resources were affected.
Fix
The report does not state what Starbucks changed. The implied fix is to remove wildcards for domains whose subdomains are not fully controlled, so that only origins the organisation actually owns are trusted in <allow-access-from>. The researcher recommends always checking a target's cross-domain policy for wildcards over domains with a takeoverable subdomain.
Variants to test
- Fetch
/crossdomain.xmlon every host in scope and list the domains inside<allow-access-from>. A positive result is any wildcard such as*.example.comwhere at least one subdomain can be taken over. - Check for dangling DNS or unclaimed services on subdomains of each listed domain. A positive result is a subdomain you can claim and serve content from.
- Look for a full wildcard
<allow-access-from domain="*" />. Treat this as low priority, since the researcher notes such sites likely have other protections in place.
What happened, in plain words
A security researcher was looking at the configuration files that websites publish, rather than at the code of the website itself. One of those files is called crossdomain.xml. It sits at the root of a site, which means it is reachable at an address like https://the-site.example/crossdomain.xml, and it is a set of instructions for a piece of software called Adobe Flash. Flash was a browser plugin, a small program that ran inside the browser to play animations, video and interactive content. The file tells Flash which other websites are allowed to load data from this site.
If a website puts a domain inside a tag called <allow-access-from> in that file, it is saying: a Flash file served from that domain may read things from me. Normally a browser stops one website from reading another website's data. That rule is called the Same Origin Policy, and it is one of the most important safety rules on the web. The crossdomain.xml file is a way for a site to make an exception to that rule for Flash. If the exception is too broad, someone else can read data they should not be able to read.
On Starbucks, the file listed many domains, and one of them was a wildcard for a domain the researcher writes as *.example.com (a stand-in name, used to keep the real one private). A wildcard is a pattern that means "anything that matches". *.example.com means "any subdomain of example.com", so shop.example.com, blog.example.com and so on. The researcher found that one subdomain of that domain could be taken over, meaning they could register it and put their own content on it. That gave them a website address that Starbucks' own configuration file said it trusted. From there they could build a Flash file that asked Starbucks for data and read the answer, including the visitor's session cookies. A session cookie is a small piece of text the browser stores for a site so the site can remember who you are between page loads; if someone else gets it, they can often act as you.
The report was filed on HackerOne, a platform where researchers report bugs to companies, and it paid a bounty of 750.00 USD. The researcher is open about the fact that at the time they found it they understood it was a configuration problem but not all of the details, and learned more after reporting it.
The idea behind it
Every website has an origin. An origin is the combination of the protocol (http or https), the host name and the port number. https://www.example.com and https://shop.example.com are two different origins even though they share a domain. The Same Origin Policy says that a page from one origin cannot read the responses of requests to another origin. It can send requests, but it cannot look at what comes back. This is what stops a malicious page you happen to open from reading your webmail in another tab.
Flash had its own way of asking for an exception to that rule. Before a Flash file from origin A reads data from origin B, Flash asks origin B for permission by fetching crossdomain.xml from B's root. If the file lists A inside an <allow-access-from> tag, the read is allowed. If it does not, the read is refused. The file is therefore a list of trusted origins, and every entry in it is a promise that the site is happy for that origin to read its data.
A subdomain takeover is when a subdomain points at a service that nobody owns any more. For example, a company might have pointed promo.example.com at a hosting provider and later stopped paying for it, leaving the DNS record in place. DNS is the system that turns names like promo.example.com into the address of a server. If the record still points at the provider and the name is free to claim there, anyone can claim it and serve their own content at that address. The company's name is still on it, but the content is the attacker's.
Put the two together: a configuration file that trusts *.example.com, and a subdomain of example.com that anyone can claim. The attacker now controls an origin that the target itself has declared trusted. The Same Origin Policy is bypassed for that origin, and the usual protection against reading another site's responses no longer applies. The report describes the result as a Same Origin Policy bypass leading to CSRF. CSRF, cross-site request forgery, is an attack where a page the victim visits causes their browser to send a request to another site using the victim's existing login. Here the goal is slightly different: the attacker wants to read the response, and the trusted origin is what makes the read possible.
Finding it
The researcher's general approach when starting penetration testing was to check out configurations, and this file was one of the configurations they looked at. Penetration testing means deliberately probing a system, with permission, to find weaknesses before someone with bad intentions does. No special accounts, roles or tools are described in the report. The precondition is simply that the target serves a crossdomain.xml at its root, and that the domains listed in it include a wildcard for a domain on which the researcher can obtain a subdomain.
Twitter's policy is given as an example of a secure configuration. It only allows access from *.twitter.com domains, because resources such as session cookies should not be shared with any other website, or the victim's account could be compromised with CSRF alone. The point of the example is that the wildcard is scoped to a domain Twitter fully controls: every subdomain of twitter.com belongs to Twitter, so trusting all of them is safe.

The image is used to illustrate Twitter as a good example of a secure cross-domain policy.
In Starbucks' case, the file contained many different domains, one of them being *.example.com. That wildcard is what made the configuration interesting: if any subdomain of that domain could be taken over, the attacker would own an origin that the policy trusts. The researcher notes that if the policy had instead been a full wildcard for any domain at all, in the form <allow-access-from domain="*" />, the site likely has other security measures in place preventing CSRF and SOP bypass, and the finding is not relevant. The issue depends on the wildcard being scoped to a specific domain that has a takeoverable subdomain, not on a blanket wildcard.
Exploitation
Step 1: Read the cross-domain policy
Request the policy from the root of the target:
This is an HTTP request, the same kind of message your browser sends when you open a page. GET is the method, meaning "give me this resource". /crossdomain.xml is the path being asked for, starting from the root of the site. HTTP/1.1 is the version of the protocol being used. In a real request there would be more lines, such as the host name and the browser's details, but the report shows only this line.
The policy contained many different domains inside <allow-access-from> tags, one of them a wildcard written as *.example.com. Reading the file is the whole of this step: it is a public file, so fetching it is no different from opening a page in a browser. The reason to do it is that the file is a written list of who the site trusts, and a list of trusted parties is exactly what an attacker wants to compare against what they can control.
Step 2: Take over a subdomain of a trusted domain
The researcher found that a subdomain of example.com could be taken over. That gives the attacker ownership of an origin that appears inside Starbucks' cross-domain policy. The report does not describe the takeover technique or the specific subdomain. The reason this step matters is that the wildcard in the policy is only dangerous if some name matching it can be made to serve attacker content. A wildcard over a domain where every subdomain is locked down is harmless; a wildcard over a domain with one claimable subdomain is a door.
Step 3: Use Flash to read cross-origin responses
With ownership of a trusted subdomain, the attacker performs CSRF to retrieve sensitive data such as session cookies. This involves making a Flash file that sends an HTTP request to a domain holding the sensitive information, and then logging the response. Because the requesting origin is included in the cross-domain policy, the response, including the sensitive cookies, is readable by the Flash file. The report does not include the Flash source or the request it sends.
The sequence is worth spelling out. That subdomain is inside the policy, so when the Flash file asks the target for data, Flash checks the policy, sees the origin is allowed, and hands the response back to the file. The file then records the response, cookies included, and the attacker reads the recording. Without the policy entry, Flash would refuse to hand over the response, and the file would see nothing.
Root cause
The mistake is in the design of the cross-domain policy: it trusts a wildcard for a domain whose subdomains are not all under the organisation's control. The policy is meant to restrict Flash cross-origin reads to the organisation's own origins, as in Twitter's *.twitter.com example, but a wildcard over a domain with a takeoverable subdomain extends that trust to an attacker-controlled origin. The Same Origin Policy is then bypassed for that origin, and the usual protection against reading another site's responses no longer applies.
A useful comparison: a guest list at a club that says "anyone with a red wristband" is fine if the club hands out the wristbands. It is not fine if red wristbands are sold in the shop next door. The wildcard is the wristband rule, and the takeoverable subdomain is the shop next door.
Impact
An attacker who owns a subdomain listed in the policy can read responses from the target that would otherwise be restricted to the origin site. In the researcher's description this is used to retrieve sensitive data such as session cookies, which can lead to compromise of the victim's account. The attack requires a subdomain takeover on a domain that appears in the policy. The report does not quantify how many users or which specific resources were affected.
Fix
The report does not state what Starbucks changed. The implied fix is to remove wildcards for domains whose subdomains are not fully controlled, so that only origins the organisation actually owns are trusted in <allow-access-from>. The researcher recommends always checking a target's cross-domain policy for wildcards over domains with a takeoverable subdomain.
Variants to test
- Fetch
/crossdomain.xmlon every host in scope and list the domains inside<allow-access-from>. A positive result is any wildcard such as*.example.comwhere at least one subdomain can be taken over. - Check for dangling DNS or unclaimed services on subdomains of each listed domain. A positive result is a subdomain you can claim and serve content from.
- Look for a full wildcard
<allow-access-from domain="*" />. Treat this as low priority, since the researcher notes such sites likely have other protections in place.
Glossary
- Adobe Flash: a browser plugin that ran animations, video and interactive content inside web pages; it is no longer supported.
- Bounty: a payment a company makes to a researcher who reports a valid security problem.
- Browser: the program you use to open web pages, such as Chrome, Firefox or Safari.
- Configuration file: a file that holds settings for a piece of software, rather than program code.
- Cookie: a small piece of text a site asks the browser to store and send back on later requests, often used to remember who you are.
- CSRF (cross-site request forgery): an attack where a page the victim visits makes their browser send a request to another site using the victim's existing login.
- DNS: the system that turns names like
example.cominto the network address of a server. - Domain: a name on the internet, such as
example.com; a subdomain is a name in front of it, such asshop.example.com. crossdomain.xml: a file at the root of a site that tells Flash which other origins may read its data.<allow-access-from>: the tag insidecrossdomain.xmlthat names a trusted origin.clientaccesspolicy.xml: another policy file that grants cross-origin trust, used by Microsoft's Silverlight plugin.- Flash file: a file played by the Flash plugin, which can send requests and read responses subject to the site's policy.
- GET: the HTTP method that asks a server to return a resource.
- HackerOne: a platform where security researchers report bugs to companies and receive bounties.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- Origin: the combination of protocol, host name and port that identifies where a page came from.
- Penetration testing: deliberately probing a system, with permission, to find weaknesses before someone with bad intentions does.
- Same Origin Policy (SOP): the browser rule that one origin cannot read another origin's responses.
- SOP bypass: a way of getting around the Same Origin Policy so that one origin can read another's data.
- Subdomain takeover: claiming a subdomain that still points at a service nobody owns, so that your content is served under the company's name.
- Wildcard: a pattern meaning "anything that matches", such as
*.example.comfor any subdomain ofexample.com.