Skip to content
Access control Write-up Intermediate

Shopify Athena Bug

An unauthenticated GraphQL endpoint on a Shopify support dashboard allowed querying support tickets for any shop domain, returning requester names, subjects and full ticket contents. An attacker could also create support tickets on behalf of other agents, leading to disclosure of confidential user information.

Rojan Rijal Follow

Published on sites.google.com

For past few months, I have switched my target in bug bounty to Shopify in hopes to find vulnerabilities on it. Usually before I start hacking a program, I try to set certain goals on what I want to achieve out of it.

Rojan Rijal (@uraniumhacker), on sites.google.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

Shopify runs a large number of internal and public services across its own domains. Some of these sit on *.shopifycloud.com, and during earlier reconnaissance the researcher noticed that some of those hosts redirected to shopify.okta.com, which suggested that internal Shopify sites were also hosted there.

The write-up concerns two new hosts that appeared under that domain: athena-flex.shopifycloud.com and athena-flex-production.shopifycloud.com. The report does not describe what Athena is meant to do for its users. What it does show is that the application exposed a GraphQL endpoint that could return Zendesk support ticket data for a given shop domain, and that this endpoint answered requests without authentication.

Setup

The researcher had been working on the Shopify program for several months and had set an explicit goal: gain access to internal information or applications that Shopify uses. The report lists three routes to that goal: SSRF, RCE, and unauthenticated access to potentially sensitive sites such as JIRA.

To support this, the researcher built a reconnaissance script and later an alert system that watched for new products, news and subdomains on Shopify's internal and public domains, sending alerts to a Slack instance. The alerts were configured to scan for anything new on *.shopifycloud.com. New subdomains were picked up from crt.sh.

Tools used in the steps below: a screenshot service attached to the researcher's server, a browser, and Burp to intercept and modify requests. No account on the Athena service is mentioned, and none was needed.

Finding it

An alert fired for two new subdomains seen in crt.sh:

  1. athena-flex.shopifycloud.com
  2. athena-flex-production.shopifycloud.com

The screenshot the researcher's server had taken of the site was a blank white page with no content, which was interesting enough to look at directly. Visiting the page redirected to Okta.

Just before closing it, the researcher intercepted the request in Burp and noticed that the site loaded momentarily and then redirected to Okta. Dropping the redirect let the page's HTML load. Since the purpose of the site was not obvious, the next step was to read the JavaScript it shipped.

Exploitation

Step 1: Read the JavaScript and find the GraphQL endpoint

Analysis of the JS revealed a /graphql endpoint. The endpoint loaded normally and accepted POST requests. To learn what it would accept, the researcher went back to the JS, which contained about three different query samples. One of them was:

JSON
{"query": "query getRecentTicketsQuery($domain: String) {\n shop(myshopifyDomain: $domain) {\n zendesk {\n tickets(last: n) {\n edges {\n node {\n id\n requester {\n name\n }\n subject\n description\n }\n }\n }\n }\n }\n }\n }","variables":{"domain":DOMAIN_NAME}}

In plain terms, the query asks the service for the last n support tickets belonging to the shop domain passed in domain, and returns the requester's name, the ticket subject (usually the title) and the description (the ticket content).

Step 2: Query the endpoint with a domain

With a working query in hand, the researcher supplied a random domain name and asked for the last 5 tickets associated with it. The service responded with 9,259 bytes of JSON data.

The response contained the full details of the support ticket, including any follow-ups the support agent had made, the requester's name and the subject. The report also notes that a malicious user could create support tickets on behalf of other agents, because there was a GraphQL query that allowed that operation.

Step 3: Report and containment

Once the researcher had enough proof of concept and a full written report, it was sent to Shopify's team. In parallel, the researcher was in contact with Pete Yaworski, who notified the on-call person so the report would be handled quickly. The service was taken down as a precaution. The team then moved the service completely over to Okta, ensuring the GraphQL endpoint would not work without authentication.

Within a week of the report, the researcher observed multiple changes to Shopify's infrastructure: internal domains that previously required Google Authentication were moving to Okta, and Google Authentication (GSuite login) itself was migrated over to Okta.

Root cause

The GraphQL endpoint on the host accepted POST requests and returned ticket data for a supplied domain. The only thing standing between a visitor and the application was a client-side redirect to Okta: the page loaded first and redirected afterwards, so dropping the redirect in an intercepting proxy left the application HTML and its JavaScript in hand. The JavaScript then handed over a ready-made query that read Zendesk tickets by shop domain, and the endpoint executed it for any domain supplied.

The page content was delivered before the redirect to Okta, so dropping the redirect left the application HTML and JavaScript accessible. The report does not describe the server-side code, so whether the endpoint had any check at all, or only a check that could be bypassed, is not stated. The query selected tickets by the shop domain supplied in the domain variable.

Impact

The researcher supplied a random domain name and received the last 5 tickets for it, with full details. including requester names, subjects, descriptions and support agent follow-ups. The researcher describes this as potentially leading to massive disclosure of user information and confidential information shared through support tickets. The report also states that tickets could be created on behalf of other agents through a GraphQL query, though the exact query is not reproduced.

Fix

Shopify took the service down as a precaution and then moved it completely over to Okta, so that the GraphQL endpoint would not work without authentication. This is the change the report describes. A week after the report, the researcher saw internal domains moving from Google Authentication to Okta, and GSuite login itself migrated to Okta.

Variants to test

  1. Client-side-only redirects in front of APIs. Intercept the first response and drop the 3xx to Okta (or any SSO) and inspect the body for API paths and JavaScript bundles. A positive result is application HTML or JS that references an API endpoint, as happened here with /graphql.
  2. Query samples left in front-end bundles. Grep the JS for query, mutation and variable names. A positive result is a complete, runnable operation with its variables, which can be replayed against the endpoint.
  3. Unauthenticated POST to discovered GraphQL endpoints. Send the sample operation with a value you control in the domain or tenant variable. A positive result is a populated JSON response rather than an auth error or an empty result.
  4. Tenant or domain variables as the only access control. Swap the identifier for another organisation's and compare response sizes and contents. A positive result is data belonging to a different tenant, as with the 9,259-byte ticket response here.
  5. Write operations in the same schema. Look for mutations that create objects on behalf of other users, such as ticket creation attributed to an agent. A positive result is a created object visible under another identity.
  6. New-subdomain monitoring. Watch crt.sh for hosts under a cloud domain that also serves internal SSO, then screenshot and probe each new host. A positive result is a host that loads content before redirecting to SSO, which is the signal that led to Athena.

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

What happened, in plain words

Shopify is a company that runs an online platform where people build shops and sell things. Like most large companies, it has many websites and online services, some public (anyone can reach them) and some internal (meant only for staff). A security researcher spent several months looking at Shopify's systems, hoping to reach something internal. One morning an automatic alert told him that two new website names had appeared under one of Shopify's domains. He looked at them, found a web application whose GraphQL endpoint returned customer support ticket data for a supplied domain, and reported it. Shopify took the service offline and moved it behind a login system called Okta.

This article walks through that story from the beginning, explaining each idea as it comes up. You only need to know how to use a browser.

Starting with...

A bug bounty programme is an arrangement where a company says: if you find a security problem in our systems and tell us privately, we may pay you a reward. Researchers who take part are called bug bounty hunters. The researcher in this story had recently decided to focus on Shopify.

Before starting on a programme, he liked to set himself a goal. Sometimes the goal was a number of bugs, sometimes a particular kind of bug. For Shopify he chose a deliberately vague goal: "I want to gain access to internal information or applications that Shopify uses". Vague was intentional, because there are several different ways to reach that goal, and he listed three:

  1. SSRF (Server-Side Request Forgery): tricking a company's server into making a request on your behalf, for example to an internal address you cannot reach yourself. Think of asking a receptionist to fetch a document from a locked room: you never enter the room, but the document comes to you.
  2. RCE (Remote Code Execution): getting your own code to run on someone else's server. That is the most severe kind of compromise, because the attacker effectively controls the machine.
  3. Unauthenticated access to sensitive sites: reaching something like an internal JIRA (a tool teams use to track tasks and bugs) without logging in at all. "Unauthenticated" simply means "without proving who you are".

With that goal in mind, he started writing a reconnaissance script. Reconnaissance ("recon") is the information-gathering phase: finding out which websites, subdomains and services a company has, before trying to break anything. A script is a small program that automates repetitive work.

Hacking Shopify...

He had submitted his first Shopify bug about nine months earlier. At the time it was out of scope: bug bounty programmes define a scope, a list of systems that are fair game, and findings outside it usually earn nothing. The feature involved was a product called Shopify Exchange, which was still being rolled out. Later, once the product was in scope, he came back to it and found an IDOR.

IDOR stands for Insecure Direct Object Reference. It means a website lets you reach someone else's data by changing an identifier in a request, for example changing a number in a URL from your own to another user's, because the server does not check that the object belongs to you. A simple comparison: a hotel where room keys are numbered and any key opens any door with the matching number.

In this case the IDOR let him change images and uploads belonging to other users of the product. He reported it, and the report is numbered 322661 on the bug bounty platform.

After that, he decided to spend the next few months on Shopify not just to find bugs but to understand the company: which products it had, and what it used internally, such as programming languages and vendors (outside suppliers of software). He noticed he was spending a lot of time manually searching for assets and products, so he started automating part of that work. Doing so led him to a support dashboard page for Shopify's DataDog system, a monitoring service that companies use to watch their servers and applications. That finding became report 345152.

He kept improving his code until he had built an alert system. It watched for new products, news and subdomains on Shopify's internal and public domains, and sent him a message on Slack (a chat tool) whenever something new appeared.

The alerts were set to scan for anything new on *.shopifycloud.com. The * is a wildcard meaning "any name in front of", so the rule covered every subdomain of shopifycloud.com. A subdomain is a name that sits under a main domain: in mail.example.com, mail is the subdomain and example.com is the domain. He chose this domain because earlier manual recon, and conversations with Shopify staff, had shown that some of these hosts redirected to shopify.okta.com. Okta is a single sign-on service: a company's staff log in once with Okta and then reach many internal applications without logging in again. A redirect to Okta therefore hinted that internal Shopify sites were hosted under shopifycloud.com too.

One day an alert arrived for a new subdomain found in crt.sh. crt.sh is a public search engine for certificate transparency logs. Certificate transparency is a public record that every website certificate must be listed in; certificates are the small files that make the padlock appear in a browser. Because every new HTTPS site gets a certificate and every certificate is logged publicly, watching these logs is a standard way to discover new subdomains, even ones nobody has linked to yet.

The two new names were:

  1. athena-flex.shopifycloud.com
  2. athena-flex-production.shopifycloud.com

His server had automatically taken a screenshot of each site. The screenshot was a blank white page with no content, which was interesting enough to look at directly. When he opened the page in a browser, it redirected to Okta.

Just as he was about to close it, he decided to intercept the request with Burp. Burp (Burp Suite) is a tool that sits between your browser and the website, like a postman who opens every letter, reads it, and can change it or throw it away before delivering it. With it you can pause a request or a response and edit it.

Intercepting showed something important: the website loaded momentarily and then redirected to Okta. In other words, the page's content arrived first, and the redirect to the login service came afterwards. That order matters. If the content is already in your browser before the redirect, you can stop the redirect and keep the content. He dropped the redirect and looked at the HTML of the page.

HTML is the language web pages are written in: the structure of headings, text, buttons and links. He still had no idea what the site was for, so he turned to the JavaScript file the site loaded. JavaScript is the programming language that runs inside the browser and makes pages interactive; it is delivered as files the page downloads, and anyone can read those files.

Analysing the JS...

Reading the JavaScript, he found a /graphql endpoint. An endpoint is a specific address on a server that accepts requests, like a particular counter in a large office. GraphQL is a way for a client (the browser) to ask a server for exactly the data it wants, using a query written in a structured format. Unlike a traditional API where the server decides what each address returns, GraphQL exposes one address and the client describes the shape of the answer. An API (Application Programming Interface) is simply the set of addresses and rules a program uses to talk to another program; think of it as the service window where you place an order rather than walking into the kitchen.

The endpoint loaded fine and accepted POST requests. POST is one of the methods of the HTTP protocol, the language browsers and servers speak. A GET request asks for something (like loading a page); a POST request sends data to the server (like submitting a form). The endpoint accepting POST meant it was built to receive queries.

He still needed to know what kind of queries it allowed, so he read the JavaScript again. It contained about three different query samples, ready-made examples left in the code. One of them was:

JSON
{"query": "query getRecentTicketsQuery($domain: String) {\n shop(myshopifyDomain: $domain) {\n zendesk {\n tickets(last: n) {\n edges {\n node {\n id\n requester {\n name\n }\n subject\n description\n }\n }\n }\n }\n }\n }\n }","variables":{"domain":DOMAIN_NAME}}

Line by line, in plain words:

  • The whole thing is a JSON object, a common text format for structured data: curly braces hold named fields.
  • "query" holds the GraphQL query itself, written as one long string. The \n sequences are newline characters, so the query is formatted over several lines even though it is stored as a single line of text.
  • query getRecentTicketsQuery($domain: String) declares a named query called getRecentTicketsQuery that takes one input, $domain, which is text (a String). The $ marks a variable, a placeholder filled in later.
  • shop(myshopifyDomain: $domain) asks for a shop, identified by the domain passed in. A shop domain is the address of a Shopify store, such as the name a customer would type in a browser.
  • zendesk selects the shop's Zendesk data. Zendesk is a customer support system: companies use it to receive, track and answer support requests. Each request becomes a ticket, a record with a subject, a description and a history of replies.
  • tickets(last: n) asks for the last n tickets. The n is a placeholder for a number.
  • edges and node are GraphQL's way of wrapping a list of results; each node is one ticket.
  • Inside each ticket it asks for id, requester { name } (the name of the person who opened the ticket), subject (usually the title) and description (the content of the ticket).
  • The second part, "variables":{"domain":DOMAIN_NAME}, supplies the value for $domain. DOMAIN_NAME is a placeholder for a real shop domain.

Translated into human language: this asks the service to list the last n support tickets for the domain DOMAIN_NAME, and to return the requester's name, the ticket subject and the ticket description.

Once he had a query he could run, he put in a random domain name and asked for the last 5 tickets for that domain. After a wait, the service responded with 9,259 bytes of JSON data. A byte is a unit of data size; 9,259 bytes is a few pages of text, far more than an error message would be.

The response contained the full details of the support ticket, including any follow-ups the support agent had made, the requester's name and the subject. This is the core of the problem: the query returned full support ticket details for the domain supplied. The report adds that a malicious person could also create support tickets on behalf of other agents, because there was a GraphQL query that allowed that operation. The report adds that a GraphQL query existed that would allow creating support tickets on behalf of other agents.

He describes the potential result as massive disclosure of user information and confidential information shared through support tickets.

Once he had enough proof of concept and a full written report, he sent it to Shopify's team. A proof of concept (PoC) is the smallest demonstration that a problem is real: here, a request and its response showing ticket data coming back without a login. At the same time he was talking with Pete Yaworski, who notified the on-call person so the report would be handled as soon as possible. The service was then taken down as a precaution. After that, the team moved the service completely over to Okta, making sure the GraphQL endpoint would not work without authentication.

A week after the report, he saw multiple changes on Shopify's infrastructure. All the internal domains that previously required Google Authentication were moving to Okta, and Google Authentication (GSuite login) itself was also migrated over to Okta. Google Authentication here means logging in with a Google account, the same way you sign in to Gmail; GSuite is Google's set of workplace tools. Moving to Okta means one login system now guards those internal sites.

Why it worked

The GraphQL endpoint on the host accepted POST requests and returned ticket data for a supplied domain. The only thing standing between a visitor and the application was a client-side redirect to Okta. "Client-side" means the browser does it, not the server: the page loaded first and redirected afterwards, so dropping the redirect in an intercepting proxy left the application HTML and its JavaScript in hand. The JavaScript then handed over a ready-made query that read Zendesk tickets by shop domain, and the endpoint executed it for any domain supplied.

The page content was delivered before the redirect to Okta, so dropping the redirect left the application HTML and JavaScript accessible. Authorisation is the check of whether you are allowed to do something, as opposed to authentication, which is the check of who you are. A redirect is not a lock: it is a signpost saying "go and log in over there". If the content is already delivered before the signpost, the signpost can be ignored. The report does not describe the server-side code, so whether the endpoint had any check at all, or only a check that could be bypassed, is not stated. The query selected tickets by the shop domain supplied in the domain variable.

What the impact was

The researcher supplied a random domain name and received the last 5 tickets for it, with full details. including requester names, subjects, descriptions and support agent follow-ups. The researcher describes this as potentially leading to massive disclosure of user information and confidential information shared through support tickets. The report also states that tickets could be created on behalf of other agents through a GraphQL query, though the exact query is not reproduced.

The report does not give a count of affected shops or tickets, nor does it state which domains were tested beyond "a random domain name".

How it was fixed

Shopify took the service down as a precaution and then moved it completely over to Okta, so that the GraphQL endpoint would not work without authentication. This is the change the report describes. A week after the report, the researcher saw internal domains moving from Google Authentication to Okta, and GSuite login itself migrated to Okta.

Things worth trying on other targets

These are the general lessons from the case, phrased as things a beginner can try on a programme that allows it.

  1. Client-side-only redirects in front of APIs. Intercept the first response and drop the 3xx to Okta (or any SSO) and inspect the body for API paths and JavaScript bundles. A 3xx is the family of HTTP status codes that mean "look elsewhere"; dropping it means telling your proxy not to follow it. A positive result is application HTML or JS that references an API endpoint, as happened here with /graphql.
  2. Query samples left in front-end bundles. Search the JavaScript for query, mutation and variable names. A mutation is a GraphQL operation that changes data rather than reading it. A positive result is a complete, runnable operation with its variables, which can be replayed against the endpoint.
  3. Unauthenticated POST to discovered GraphQL endpoints. Send the sample operation with a value you control in the domain or tenant variable. A tenant is one organisation's separate space inside a shared service. A positive result is a populated JSON response rather than an auth error or an empty result.
  4. Tenant or domain variables as the only access control. Swap the identifier for another organisation's and compare response sizes and contents. A positive result is data belonging to a different tenant, as with the 9,259-byte ticket response here.
  5. Write operations in the same schema. Look for mutations that create objects on behalf of other users, such as ticket creation attributed to an agent. A schema is the description of what a GraphQL service accepts. A positive result is a created object visible under another identity.
  6. New-subdomain monitoring. Watch crt.sh for hosts under a cloud domain that also serves internal SSO, then screenshot and probe each new host. A positive result is a host that loads content before redirecting to SSO, which is the signal that led to Athena.

Glossary

  • API: the set of addresses and rules one program uses to talk to another; the service window rather than the kitchen.
  • Authentication: proving who you are, usually by logging in.
  • Authorisation: the check of whether you are allowed to do a particular thing.
  • Bug bounty programme: a scheme where a company pays researchers who privately report security problems.
  • Burp (Burp Suite): a tool that sits between browser and server, letting you read, pause and modify requests and responses.
  • Byte: a unit of data size; 9,259 bytes is a few pages of text.
  • Certificate: a small file that proves a website's identity and enables the padlock in the browser.
  • Certificate transparency: a public log that every website certificate must be listed in.
  • Client-side: happening in the browser rather than on the server.
  • crt.sh: a public search engine for certificate transparency logs, used to discover subdomains.
  • DataDog: a monitoring service companies use to watch servers and applications.
  • Domain: the main name of a website, such as example.com.
  • Endpoint: a specific address on a server that accepts requests.
  • GET: an HTTP method that asks for something, such as loading a page.
  • GraphQL: a way for a client to ask a server for exactly the data it wants, using a structured query at a single address.
  • GSuite: Google's set of workplace tools, including its login.
  • HTML: the language web pages are written in, describing their structure.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • IDOR (Insecure Direct Object Reference): a flaw where changing an identifier in a request gives access to someone else's data because ownership is not checked.
  • JavaScript: the programming language that runs in the browser and makes pages interactive; its files are readable by anyone.
  • JIRA: a tool teams use to track tasks and bugs.
  • JSON: a common text format for structured data, built from named fields in curly braces.
  • Mutation: a GraphQL operation that changes data rather than reading it.
  • Okta: a single sign-on service that lets staff log in once and reach many internal applications.
  • Out of scope: outside the list of systems a bug bounty programme allows you to test.
  • POST: an HTTP method that sends data to the server, such as submitting a form.
  • Proof of concept (PoC): the smallest demonstration that a problem is real.
  • Reconnaissance (recon): the information-gathering phase of finding a company's websites and services.
  • Redirect: a server response telling the browser to go to a different address.
  • Schema: the description of what a GraphQL service accepts.
  • Scope: the list of systems a bug bounty programme allows you to test.
  • Script: a small program that automates repetitive work.
  • Single sign-on (SSO): logging in once to reach many separate applications.
  • Slack: a chat tool used by teams.
  • SSRF (Server-Side Request Forgery): tricking a company's server into making a request on your behalf.
  • Subdomain: a name under a main domain, such as mail in mail.example.com.
  • Tenant: one organisation's separate space inside a shared service.
  • Ticket: a record in a support system with a subject, a description and a history of replies.
  • Wildcard: a symbol such as * that stands for any name.
  • Zendesk: a customer support system companies use to receive, track and answer support requests.
  • 3xx: the family of HTTP status codes meaning "look elsewhere", used for redirects.

More by Rojan Rijal

View all

20 more disclosed reports, best first.

More from Shopify

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.