Get analytics token using only apps permission
A staff member holding only the 'apps' permission could query a GraphQL operation that returned the embedded analytics token of any installed app that can read reports. That token then allowed them to read the store's sales reports, which normally require explicit dashboard or reports permission.
- Triaged in 5 days
- Fixed in 40 days
- Paid in 7 days
- Disclosed after 2 months
It seems apps that can read "analytics" have embedded analytic token. In order to access the /admin/reportify/token.json endpoint explicit dashboard or reports permission is required. A staff member with just "apps" permission can leverage the permissions of apps that can read reports to extract their embedded analyticsToken as long as the appropriate query which is provided below is used. The apikey of the POS app is used here as a variable (see token.png for more).
{"operationName":"EmbeddedAppAnalyticsToken","variables":{"apiKey":"a53cf2ce9b5dabf5dd222b3615c29569"},"query":"query EmbeddedAppAnalyticsToken($apiKey:String!){appByKey:appByKey(apiKey:$apiKey){id installation{id legacyEasdkAnalyticsToken __typename}__typename}}"}
Now, in order to read the store's reports the token gotten from above is used in the query below. POST /validate?beta=true&dataOnly=false HTTP/1.1 Host: analytics.shopify.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0 Accept: application/json Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded;charset=UTF-8 Origin: https://foobar.myshopify.com
q%5B%5D=SHOW+orders%2C+gross_sales%2C+discounts%2C+returns%2C+net_sales%2C+shipping%2C+taxes%2C+total_sales+OVER+day+FROM+sales+SINCE+-30d+UNTIL+today+ORDER+BY+day&source=new-admin&token={token_here}
Impact
Staff member can perform actions they don't have permission to
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the GraphQL app lookup returned the embedded analytics token without checking that the caller held the reports or dashboard permission that token represents.
Impact
A staff member could perform actions they were not granted permission for, namely reading the store's sales reports.
What the attacker needed
A staff account with only the apps permission; an installed app that can read reports
How it was found
- Send a GraphQL query asking for an app's installation analytics token, using the app's API key.
- Take the returned analytics token.
- Send a request to the analytics validation endpoint with that token and a sales report query.
- Read the store's sales report data.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In a shop platform, staff accounts have separate permissions, and one permission should not unlock another. Here a low-privilege staff member could ask the platform for an app's secret analytics token, then use that token to view sales reports they were never granted access to.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.