Unauthenticated access to Zendesk tickets through athena-flex-production.shopifycloud.com Okta bypass
An internal Shopify system that appeared to be protected by Okta authentication actually served its JavaScript and exposed a GraphQL endpoint without authentication. An attacker could query this endpoint to retrieve Zendesk ticket details, including descriptions and requester names, for any shop domain.
Originally disclosed on HackerOne
- Triaged in 1 hour
- Fixed in 31 days
- Paid in 14 hours
- Disclosed after 31 days
Summary by the program
@rijalrojan discovered an application and endpoint under athena-flex-production.shopifycloud.com that exposed metadata and contents of our Zendesk tickets. Within a couple hours, we had put it behind an OAuth portal to mitigate the issue. After an internal investigation revealed no evidence of malicious access to the data, we rewarded him with the highest bounty available under our non-core authentication bypass category ($5,000). We did this despite the app being out of scope because of the severity of the information disclosure. As always, out-of-scope rewards are at our sole discretion.
The report
Summary
athena-flex-production.shopifycloud.com seems to be an internal system that Shopify uses because it redirects user to Okta login. During this however, I noticed that it first returns 200 and then does a redirect meaning some part of the website loads before redirecting. With this, I was able to get the JS being used in the system. Through the JS file, I found a path that allows GraphQL queries thus resulting in a full dump of Zendesk ticket information.
Description
When you originally go to athena-flex-production.shopifycloud.com you will find that it will redirect to Okta. However if you do view-source:athena-flex-production.shopifycloud.com in Chrome, it will show that the website loads momentarily. In one of the script src, there is this link requested by the website:
When you beautify the JS file you will notice it has some query data that can be used at the /graphql endpoint. After I got this, I started to play around with the GraphQL schema and see what I could gain access to.
For my test I sent:
{"query": "query getRecentTicketsQuery($domain: String) {\n shop(myshopifyDomain: $domain) {\n zendesk {\n tickets(last: 5) {\n edges {\n node {\n id\n requester {\n name\n }\n subject\n description\n }\n }\n }\n }\n }\n }\n","variables":{"domain":"ok.myshopify.com"}}
What this query says is: Return last 5 tickets with description, reporter name and subject of the ticket that contain domain ok.myshopify.com. Once the query was done, it responded with 9,259 bytes of JSON response that contained extremely critical data.
I don't want to paste the data here for obvious reason but I am attacking the file here so you can delete it by contact [email protected] later if you wish to disclose the report.
Reproduction
- Send the following curl request:
curl -i -s -k -X $'POST' \
-H $'Host: athena-flex-production.shopifycloud.com' -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0' -H $'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H $'Accept-Language: en-US,en;q=0.5' -H $'Accept-Encoding: gzip, deflate' -H $'Content-Type: application/json' -H $'Connection: close' -H $'Upgrade-Insecure-Requests: 1' -H $'Content-Length: 422' \
--data-binary $'{\"query\": \"query getRecentTicketsQuery($domain: String) {\\n shop(myshopifyDomain: $domain) {\\n zendesk {\\n tickets(last: 5) {\\n edges {\\n node {\\n id\\n requester {\\n name\\n }\\n subject\\n description\\n }\\n }\\n }\\n }\\n }\\n }\\n\",\"variables\":{\"domain\":\"ok.myshopify.com\"}}' \
$'https://athena-flex-production.shopifycloud.com/graphql'
More information
There is also an API key that I found on the JS file. I think this might be the Zendesk api key but I am not yet sure:
R = n.n(O)()({
apiKey: "5c0246635b3c77189888c0b10d3427ac",
notifyReleaseStages: ["production"],
releaseStage: "production"
}),
Impact
- Get ticket description means dumping any detail you want.
- Creating zendesk ticket in behalf of other agents.
- Changing state of other tickets.
I will post list of all functions that is possible in this graphql.
Context
athena-flex-production.shopifycloud.com is an internal Shopify system. From the outside it behaves like an Okta-protected application: a visitor is redirected to an Okta login before anything useful is shown. The report describes it as a system that Shopify uses internally, and the data behind it includes Zendesk tickets belonging to Shopify shops.
The asset named in the report metadata is partners.shopify.com, but the application and endpoint that the researcher actually attacked sit on the athena-flex-production.shopifycloud.com host. The program's own summary notes that the app was out of scope and that the reward was paid at the program's discretion because of the severity of the information disclosure.
Setup
No account, role or special access is described. The whole point of the finding is that none was needed: the researcher worked from an unauthenticated position, using a browser and command-line tooling.
The tools mentioned are Chrome (for view-source:), a JavaScript beautifier, and curl for the reproduction. No versions beyond the browser user agent string in the request are given.
Finding it
The researcher noticed that the Okta redirect is not the first thing that happens. Requesting the host returns HTTP 200 first and only then performs the redirect, which means part of the site is served before the authentication gate takes effect. That gap is what made the client-side code reachable.
Using view-source:athena-flex-production.shopifycloud.com in Chrome showed the page loading momentarily. Among the script sources requested by the page was this file:
https://cdn.shopifycloud.com/athena-flex/assets/main-[redacted].js
After beautifying that JavaScript, the researcher found query data in it that could be used against a /graphql endpoint. The bundle therefore disclosed both the existence of the GraphQL endpoint and the shape of the queries the application sends to it.
Exploitation
Step 1: Probe the GraphQL schema
With the endpoint and a sample query in hand, the researcher started experimenting with the GraphQL schema to see what was reachable. The test query sent was:
{"query": "query getRecentTicketsQuery($domain: String) {\n shop(myshopifyDomain: $domain) {\n zendesk {\n tickets(last: 5) {\n edges {\n node {\n id\n requester {\n name\n }\n subject\n description\n }\n }\n }\n }\n }\n }\n","variables":{"domain":"ok.myshopify.com"}}
The query takes a $domain variable and resolves shop(myshopifyDomain: $domain), then walks into the shop's zendesk object and asks for the last five tickets. For each ticket it requests the id, the requester's name, the subject and the description. In plain terms: return the last five tickets, with description, requester name and subject, for the shop whose domain is ok.myshopify.com.
The response was 9,259 bytes of JSON containing what the researcher describes as extremely critical data. The ticket contents themselves are not reproduced in the report; the researcher deliberately withheld them and instead attached them as a file so that the program could decide what to disclose.
Step 2: Reproduce with curl
The reproduction is a single unauthenticated POST to the GraphQL endpoint:
curl -i -s -k -X $'POST' \
-H $'Host: athena-flex-production.shopifycloud.com' -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0' -H $'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H $'Accept-Language: en-US,en;q=0.5' -H $'Accept-Encoding: gzip, deflate' -H $'Content-Type: application/json' -H $'Connection: close' -H $'Upgrade-Insecure-Requests: 1' -H $'Content-Length: 422' \
--data-binary $'{\"query\": \"query getRecentTicketsQuery($domain: String) {\\n shop(myshopifyDomain: $domain) {\\n zendesk {\\n tickets(last: 5) {\\n edges {\\n node {\\n id\\n requester {\\n name\\n }\\n subject\\n description\\n }\\n }\\n }\\n }\\n }\\n }\\n\",\"variables\":{\"domain\":\"ok.myshopify.com\"}}' \
$'https://athena-flex-production.shopifycloud.com/graphql'
The important parts are the Host header pinning the request to the internal host, the Content-Type: application/json header, and the --data-binary body carrying the same query and variables object as the earlier test. There is no Cookie header and no bearer token: the request relies on nothing but the endpoint being reachable. The -k flag disables certificate verification, and -i asks curl to print the response headers alongside the body.
Step 3: Look for other secrets in the bundle
The researcher also found an API key in the JavaScript file and suspected it was a Zendesk API key, while noting that this was not yet confirmed:
R = n.n(O)()({
apiKey: "[redacted]",
notifyReleaseStages: ["production"],
releaseStage: "production"
}),
The surrounding code is a client-side configuration object with a production release stage. The report does not establish what the key grants access to.
Root cause
The authentication check was applied as a redirect rather than as an authorisation gate on the resources themselves. The host answered with a 200 and content before sending the browser to Okta, so the JavaScript bundle and the /graphql endpoint were reachable without a session. The GraphQL resolver for shop(myshopifyDomain:) returned Zendesk ticket data for the domain supplied by the caller, without an authenticated session. Because the query language lets a client ask for exactly the fields it wants, the same endpoint that powered the internal UI could be used to pull ticket descriptions in bulk.
Impact
The researcher lists three consequences:
- Reading ticket descriptions, which means dumping any detail contained in a ticket.
- Creating Zendesk tickets on behalf of other agents.
- Changing the state of other tickets.
The demonstrated part is the first: a single query returned the last five tickets, including descriptions and requester names, for a chosen shop domain. The other two are stated as capabilities the researcher believed the GraphQL surface allowed; the report does not show requests for them. The researcher also said a list of all functions possible through this GraphQL would follow.
On the program side, the endpoint was placed behind an OAuth portal within a couple of hours of the report. An internal investigation found no evidence of malicious access to the data, and the researcher was paid $5,000, the highest bounty available under the non-core authentication bypass category, despite the app being out of scope.
Fix
The program's mitigation was to put the application and endpoint behind an OAuth portal, closing the window in which the host served content before the Okta redirect. That addresses the exposure at the edge.
Variants to test
- 200-then-redirect hosts. Request an internal-looking host without cookies and inspect the raw response with
curl -i. A positive result is a 200 whose body contains script tags, asset paths or API routes before any redirect to an identity provider. - GraphQL endpoints named in JavaScript bundles. Beautify the bundles served by such a host and search for
query,mutationand/graphql. A positive result is a schema shape you can replay against the endpoint unauthenticated. - Domain-scoped resolvers. Where a query takes a shop or tenant identifier such as
myshopifyDomain, substitute a domain you do not own. A positive result is data returned for that domain without an authenticated session. - Sensitive fields on integration objects. Ask for
description,requester,subjectand similar fields on ticket or support objects. A positive result is free-text content from real tickets rather than empty or redacted values. - Keys in client bundles. Look for configuration objects with
apiKeyand release-stage fields. A positive result is a key that authenticates against the third-party service it appears to belong to; confirm before reporting, since the report itself leaves this unconfirmed.
What happened, in plain words
Shopify runs an internal website at athena-flex-production.shopifycloud.com. It is meant to be private: when you visit it, it sends you to Okta, a login service, and you cannot get in without an account. Behind that login sits a system that talks to Zendesk, the helpdesk software Shopify uses to manage support tickets. A ticket is a support conversation: a customer writes in, an agent replies, and the whole thread is stored.
The researcher, @rijalrojan, noticed that the website did not wait for the login before it started answering. It first sent back a normal page (an HTTP 200 response) and only afterwards told the browser to go to Okta. In that brief moment, part of the site was already delivered, including a JavaScript file. JavaScript files are the code a website runs inside your browser, and they are readable by anyone who can download them. Inside that file was a description of a GraphQL endpoint. GraphQL is a way for a program to ask a server for exactly the data it wants, a bit like filling in a very precise order form: you name the fields and the server returns them. The endpoint was reachable without logging in, and it returned Zendesk ticket contents for the shop domain the researcher named.
The researcher sent one query and got back 9,259 bytes of JSON (a text format for structured data) containing ticket details. He did not publish the ticket contents; he attached them as a file so the program could decide what to disclose. Shopify put the application behind an OAuth portal (a proper login gate) within a couple of hours, found no evidence that anyone else had abused the data, and paid $5,000, the highest bounty available in its non-core authentication bypass category. The app was out of scope, and the program says out-of-scope rewards are at its sole discretion.
The pieces involved
- The host:
athena-flex-production.shopifycloud.com, described in the report as an internal Shopify system. The report metadata namespartners.shopify.comas the asset, but the application and endpoint actually attacked are on theathena-flex-production.shopifycloud.comhost. - Okta: an identity provider. It is the login page a company uses to check who you are before letting you into internal tools.
- Zendesk: the helpdesk product. Its tickets hold the subject, the description and the requester's name, among other things.
- GraphQL: a query language for APIs. An API (application programming interface) is the door a program uses to ask another program for data or to tell it to do something. With GraphQL you write a query that lists the fields you want, and the server answers with exactly those fields.
No account, role or special access is described anywhere in the report. That is the whole point: the researcher worked without logging in, using a browser and a command-line tool.
Finding it
Step 1: Notice the order of events
The first observation was that the Okta redirect is not the first thing that happens. Requesting the host returns HTTP 200 first and only then performs the redirect. HTTP status codes are short numbers a server sends to describe the result of a request; 200 means "here is the content". A redirect is a different kind of answer that tells the browser "go somewhere else instead".
Think of a receptionist who is supposed to check your badge before letting you into an office. Here the receptionist hands you a folder first and then points you to the badge desk. The folder is already in your hands.
Because content was served before the gate, the client-side code was reachable. Client-side means it runs in the visitor's browser, so anyone who can load the page can read it.
Step 2: Read the page source
Using view-source:athena-flex-production.shopifycloud.com in Chrome showed the page loading momentarily. view-source: is a browser feature that shows the raw HTML a page is made of instead of the rendered result. HTML is the markup language that describes a web page, and it lists the scripts the page wants to load.
Among the script sources requested by the page was this file:
https://cdn.shopifycloud.com/athena-flex/assets/main-[redacted].js
This is a URL pointing at a JavaScript file on a content delivery network (a service that serves static files quickly). The long string of letters and numbers before .js is a fingerprint of the file's contents, used so browsers can cache it safely.
Step 3: Beautify the JavaScript
JavaScript delivered to browsers is often minified: stripped of spaces, line breaks and readable names to make the file smaller. A beautifier is a tool that puts the formatting back so a human can read it. After beautifying that file, the researcher found query data in it that could be used against a /graphql endpoint.
So the bundle gave away two things at once: that a GraphQL endpoint existed, and the shape of the queries the application itself sends to it. It is like finding a company's internal order form lying in the lobby: you now know the address to send it to and which boxes to tick.
Exploitation
Step 1: Probe the GraphQL schema
With the endpoint and a sample query in hand, the researcher started experimenting with the GraphQL schema to see what was reachable. A schema is the catalogue of everything a GraphQL server will answer: which objects exist, which fields they have, and which queries are allowed. The test query sent was:
{"query": "query getRecentTicketsQuery($domain: String) {\n shop(myshopifyDomain: $domain) {\n zendesk {\n tickets(last: 5) {\n edges {\n node {\n id\n requester {\n name\n }\n subject\n description\n }\n }\n }\n }\n }\n }\n","variables":{"domain":"ok.myshopify.com"}}
Line by line, in plain words:
- The outer braces make this a JSON object with two keys,
queryandvariables. JSON is a text format for structured data, and GraphQL servers commonly accept requests in it. query getRecentTicketsQuery($domain: String)declares a named query that takes one input,$domain, which is a piece of text (a string).shop(myshopifyDomain: $domain)asks for a shop, identified by its myshopify domain, which is the address a Shopify store gets by default.zendeskwalks from that shop into its Zendesk integration.tickets(last: 5)asks for the five most recent tickets.edgesandnodeare GraphQL's way of wrapping a list: each item in the list is anodeinside anedge.- Inside each ticket,
id,requester { name },subjectanddescriptionname the fields to return: the ticket number, the name of the person who opened it, the subject line and the full text of the ticket. "variables":{"domain":"ok.myshopify.com"}supplies the value for$domain, so the query runs against the shopok.myshopify.com.
In one sentence: return the last five tickets, with description, requester name and subject, for the shop whose domain is ok.myshopify.com.
The response was 9,259 bytes of JSON containing what the researcher describes as extremely critical data. The ticket contents themselves are not reproduced in the report; the researcher deliberately withheld them and attached them as a file instead, so the program could decide what to disclose.
Step 2: Reproduce with curl
The reproduction is a single unauthenticated POST to the GraphQL endpoint:
curl -i -s -k -X $'POST' \
-H $'Host: athena-flex-production.shopifycloud.com' -H $'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0' -H $'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H $'Accept-Language: en-US,en;q=0.5' -H $'Accept-Encoding: gzip, deflate' -H $'Content-Type: application/json' -H $'Connection: close' -H $'Upgrade-Insecure-Requests: 1' -H $'Content-Length: 422' \
--data-binary $'{\"query\": \"query getRecentTicketsQuery($domain: String) {\\n shop(myshopifyDomain: $domain) {\\n zendesk {\\n tickets(last: 5) {\\n edges {\\n node {\\n id\\n requester {\\n name\\n }\\n subject\\n description\\n }\\n }\\n }\\n }\\n }\\n }\\n\",\"variables\":{\"domain\":\"ok.myshopify.com\"}}' \
$'https://athena-flex-production.shopifycloud.com/graphql'
What each part does:
curlis a command-line tool for sending HTTP requests, the same kind of request a browser sends, but without the browser window.-iasks curl to print the response headers as well as the body. Headers are the small labelled lines at the top of a response, such as the status code and content type.-ssilences curl's progress meter so the output is clean.-kdisables certificate verification. Certificates are what prove a server is who it claims to be over HTTPS;-ktells curl to proceed even if that proof cannot be checked.-X $'POST'sets the method to POST. The method is the verb of an HTTP request: GET asks for something, POST sends data to the server.-Hadds a header.Hostpins the request to the internal host name.User-Agentsays which browser the request pretends to be, here Firefox 61 on Windows.AcceptandAccept-Languagedescribe what content and language the client prefers.Accept-Encodingsays it can handle compressed responses.Content-Type: application/jsontells the server the body is JSON.Connection: closeasks to close the connection after the response.Upgrade-Insecure-Requests: 1is a browser hint that it would prefer HTTPS.Content-Length: 422states the body size in bytes.--data-binarysends the body exactly as written, without stripping newlines. The body is the same query andvariablesobject as the earlier test, with the quotes and newlines escaped so they survive inside a shell command.- The final argument is the URL:
https://athena-flex-production.shopifycloud.com/graphql.
The important parts are the Host header pinning the request to the internal host, the Content-Type: application/json header, and the --data-binary body carrying the query. There is no Cookie header and no bearer token. A cookie is a small piece of data a browser stores for a site and sends back with each request, and it is how most sites remember that you are logged in. A bearer token is a similar credential sent in a header instead. Neither is present: the request relies on nothing but the endpoint being reachable.
Step 3: Look for other secrets in the bundle
The researcher also found an API key in the JavaScript file and suspected it was a Zendesk API key, while noting that this was not yet confirmed:
R = n.n(O)()({
apiKey: "[redacted]",
notifyReleaseStages: ["production"],
releaseStage: "production"
}),
An API key is a secret string that identifies a program to a service, roughly like a password for software. This snippet is a configuration object: a bundle of settings passed to some library. apiKey holds the key. releaseStage: "production" marks the environment as the live one, and notifyReleaseStages lists the stages in which some notification behaviour should happen. The report does not establish what the key grants access to.
Why it worked
The authentication check was applied as a redirect rather than as an authorisation gate on the resources themselves. Authorisation means deciding whether a given caller is allowed to see a given thing, and it has to happen on the server, at the moment the data is requested. Here the host answered with a 200 and content before sending the browser to Okta, so the JavaScript bundle and the /graphql endpoint were reachable without a session. A session is the server's record that you logged in, usually tracked by a cookie.
The GraphQL resolver for shop(myshopifyDomain:) returned Zendesk ticket data for the domain supplied by the caller, without an authenticated session. A resolver is the function on the server that produces the data for one field in a query. Because GraphQL lets a client ask for exactly the fields it wants, the same endpoint that powered the internal UI could be used to pull ticket descriptions in bulk.
Impact
The researcher lists three consequences:
- Reading ticket descriptions, which means dumping any detail contained in a ticket.
- Creating Zendesk tickets on behalf of other agents.
- Changing the state of other tickets.
The demonstrated part is the first: a single query returned the last five tickets, including descriptions and requester names, for a chosen shop domain. The other two are stated as capabilities the researcher believed the GraphQL surface allowed; the report does not show requests for them. The researcher also said a list of all functions possible through this GraphQL would follow.
On the program side, the endpoint was placed behind an OAuth portal within a couple of hours of the report. OAuth is a standard way for one application to hand login to a separate identity provider, which is what Okta is doing here. An internal investigation found no evidence of malicious access to the data, and the researcher was paid $5,000, the highest bounty available under the non-core authentication bypass category, despite the app being out of scope. A bounty is a reward a company pays for a responsibly reported security problem, and scope is the list of systems a program says it will accept reports about.
Fix
The program's mitigation was to put the application and endpoint behind an OAuth portal, closing the window in which the host served content before the Okta redirect. That addresses the exposure at the edge.
Variants to test
These are the same ideas generalised, so you can look for similar mistakes elsewhere:
- 200-then-redirect hosts. Request an internal-looking host without cookies and inspect the raw response with
curl -i. A positive result is a 200 whose body contains script tags, asset paths or API routes before any redirect to an identity provider. - GraphQL endpoints named in JavaScript bundles. Beautify the bundles served by such a host and search for
query,mutationand/graphql. A mutation is a GraphQL request that changes data rather than reading it. A positive result is a schema shape you can replay against the endpoint unauthenticated. - Domain-scoped resolvers. Where a query takes a shop or tenant identifier such as
myshopifyDomain, substitute a domain you do not own. A positive result is data returned for that domain without an authenticated session. - Sensitive fields on integration objects. Ask for
description,requester,subjectand similar fields on ticket or support objects. A positive result is free-text content from real tickets rather than empty or redacted values. - Keys in client bundles. Look for configuration objects with
apiKeyand release-stage fields. A positive result is a key that authenticates against the third-party service it appears to belong to; confirm before reporting, since the report itself leaves this unconfirmed.
Glossary
- API: the interface one program uses to ask another program for data or to ask it to do something.
- API key: a secret string that identifies a program to a service, like a password for software.
- Authentication: proving who you are, usually by logging in.
- Authorisation: deciding whether an identified caller is allowed to access a particular resource.
- Beautifier: a tool that re-adds spaces and line breaks to minified code so a human can read it.
- Bounty: a reward a company pays for a responsibly reported security problem.
- Client-side: code that runs in the visitor's browser rather than on the server.
- Content delivery network (CDN): a service that serves static files such as scripts quickly from many locations.
- Cookie: a small piece of data a browser stores for a site and sends back with each request, often used to track a login session.
- curl: a command-line tool for sending HTTP requests.
- Endpoint: a specific URL on a server that accepts requests, such as
/graphql. - GraphQL: a query language for APIs in which the client names the exact fields it wants.
- Header: a labelled line at the top of an HTTP request or response carrying metadata such as content type or host.
- HTML: the markup language that describes the structure of a web page.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- HTTP status code: a number in a response describing the outcome, such as 200 for success or a redirect code for "go elsewhere".
- Identity provider: a service that handles logins on behalf of other applications, such as Okta.
- JavaScript: the programming language websites run in the browser.
- JSON: a text format for structured data, made of keys and values.
- Minification: stripping spaces, line breaks and readable names from code to make the file smaller.
- Mutation: a GraphQL request that changes data rather than only reading it.
- OAuth: a standard way for an application to delegate login to a separate identity provider.
- Out of scope: outside the list of systems a bounty program says it will accept reports about.
- Redirect: a server response telling the browser to go to a different URL.
- Resolver: the server-side function that produces the data for one field in a GraphQL query.
- Schema: the catalogue of objects, fields and queries a GraphQL server exposes.
- Scope: the list of systems a bounty program accepts reports about.
- Session: the server's record that a particular visitor has logged in, usually tracked by a cookie.
- Token (bearer token): a credential sent in a request header to prove the caller is allowed in.
- URL: the address of a resource on the web.
view-source:: a browser prefix that shows the raw HTML of a page instead of rendering it.- Zendesk: helpdesk software whose tickets hold support conversations, including subject, description and requester name.