# Bypass of fix #1370749

A second endpoint leaked a static storefront preview URL that never expired, granting permanent access to a password-protected store even after password change and user removal.

- Payout: $900
- Severity: low
- Program: Shopify
- Found by: encryptsaan123
- Disclosed: 2022-04-22
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1489077
- Library page: https://bugbountylibrary.com/r/h1%3A1489077
- Tags: area:web domain:web impact:internal-access kind:bounty platform:hackerone sev:low tech:cdn technique:incomplete-fix technique:source-review vuln:access-control vuln:auth-bypass vuln:info-disclosure

**Target:** Shopify admin themes endpoint /admin/online-store/themes and CDN screenshot preview URLs
**Root cause:** The fix for #1370749 only expired the preview URL surfaced in the admin UI, but a separate screenshot CDN URL embedded in the themes page response contained a different preview token that was never invalidated on password change or user removal.
**Steps:**
1. Admin invites user-a with only themes permission on shakti-jan2022.myshopify.com
2. As user-a, visit `/admin/themes` and capture the `POST /admin/online-store/themes?...` request in Burp
3. Inspect the 200 response HTML for `cdn.shopify.com/screenshots/shopify/<token>-<shopid>.shopifypreview.com` image URLs
4. Extract the preview host `z0069ofg35eaiunlanwztkkvti19n2o-62790336753.shopifypreview.com`
5. Compare with the admin UI preview URL `yok8gcda4v2iypbq-62790336753.shopifypreview.com`
6. Remove user-a and change the storefront password; the admin UI preview URL now expires
7. Revisit the screenshot-derived preview URL — it still loads the storefront permanently
**How found:** Researcher knew the prior fix (#1370749) expired the admin-UI preview URL, so they hunted for other places the preview token leaked. Reading the raw HTML of the themes page response revealed a second preview hostname embedded in CDN screenshot image URLs, which they tested against the password-change invalidation and found static.
**Exploitation:** A low-privileged user with only themes permission reads the themes page response, extracts the screenshot CDN preview hostname, and retains it. After being removed and after the storefront password is rotated, that URL continues to serve the password-protected storefront, giving persistent unauthorized access.
**Insight:** When a fix invalidates one leaked token, grep the full HTML/JSON response of the same page for other occurrences of the same hostname pattern (e.g. CDN screenshot/image URLs) — secondary renderers often mint or cache a separate token that the fix doesn't touch.

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

**Request to themes endpoint leaking preview URL**

```
POST /admin/online-store/themes?hmac=████&host=c2hha3RpLWphbjIwMjIubXlzaG9waWZ5LmNvbS9hZG1pbg&locale=en-IN&session=███&shop=shakti-jan2022.myshopify.com&timestamp=1645562098&_signed_params=host%2Clocale%2Csession%2Cshop%2Ctimestamp HTTP/1.1
Host: shakti-jan2022.myshopify.com
Connection: close
Content-Length: 581
Cache-Control: max-age=0
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "macOS"
Upgrade-Insecure-Requests: 1
Origin: null
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-Dest: iframe
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Cookie: ████

appShellSessionToken=███████&appShellAttempts=1&appShellReason=
```

