# Disclose customer orders details by shopify chat application.

Shopify Chat order-lookup endpoint validated only the email domain, letting an attacker brute-force order numbers and disclose any customer's order details.

- Payout: $2,500
- Severity: medium
- Program: Shopify
- Found by: zambo
- Disclosed: 2022-05-14
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/968165
- Library page: https://bugbountylibrary.com/r/h1%3A968165
- Tags: area:web domain:web impact:data-leak impact:pii-leak kind:bounty platform:hackerone sev:medium tech:rest technique:recon vuln:access-control vuln:idor vuln:info-disclosure

**Target:** Shopify Chat app order_lookup API endpoint
**Root cause:** The order_lookup endpoint matched the supplied email against the order's email using a partial/domain-only comparison, so an email like `@gmail.com` matched any order whose customer used a gmail address.
**Steps:**
1. Install/use Shopify Chat on a target store and start a conversation.
2. Click 'I need an update on my order' and submit an order number with a random email.
3. Send `POST /api/storefront/conversations/<token>/order_lookup` with body `{"order_lookup":{"email":"@gmail.com","order_number":"1005","user_token":"..."}}`.
4. Iterate order_number from #1000 upward to enumerate orders.
5. Read returned order details for each matching order.
**How found:** Noticed the bot asks for Order ID + Email, then tried stripping the local part of the email to see if validation was a substring/domain match rather than exact equality.
**Exploitation:** Attacker supplies only the email domain (e.g. `@gmail.com`) instead of a full address; the backend's partial match accepts it for any order whose customer email shares that domain. Brute-forcing sequential order numbers (#1000+) enumerates and discloses order details including sensitive customer information.
**Insight:** When a lookup requires two fields (ID + email), test whether the email check is a substring/domain match by submitting only `@domain.com`; sequential numeric IDs then turn it into full enumeration.

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

**Order lookup request with stripped email**

```
POST /api/storefront/conversations/lx9vF-DR31d1ePOOCS0Uw2lFUUBjhNqmMTOdkeM631M/order_lookup HTTP/1.1
Host: shopify-chat.shopifycloud.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:79.0) Gecko/20100101 Firefox/79.0
Accept: /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://okbay44.myshopify.com/
Content-Type: application/json
X-Shopify-Chat-Shop-Identifier: █████████
Origin: https://okbay44.myshopify.com
Content-Length: 113
DNT: 1
Connection: close

{"order_lookup":{"email":"@gmail.com","order_number":"1005","user_token":"███"}}
```

