# Removing parts of URL from jQuery request exposes links for download of Paid Digital Assets of the most recent Order placed by anyone on the store!

Empty checkout_token on Shopify's delivery.shopifyapps.com get_download_link endpoint returned the most recent order's digital download links for any store.

- Payout: $2,900
- Severity: medium
- Program: Shopify
- Found by: adarshxs
- Disclosed: 2021-07-08
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1044285
- Library page: https://bugbountylibrary.com/r/h1%3A1044285
- Tags: area:web domain:web impact:data-leak impact:integrity kind:bounty platform:hackerone sev:medium tech:rest technique:param-pollution vuln:access-control vuln:business-logic vuln:idor

**Target:** delivery.shopifyapps.com /checkout/get_download_link and /checkout/check_order JSONP endpoints
**Root cause:** Server did not validate checkout_token; when nil, it fetched all orders and returned the latest one instead of scoping to the caller's checkout.
**Steps:**
1. Identify a Shopify store selling digital assets using the Digital Downloads app.
2. Request `GET https://delivery.shopifyapps.com/checkout/get_download_link?callback=jQuery&shop=<store>.myshopify.com&checkout_token=` with empty token.
3. Observe JSONP response containing download URL of the most recent order.
4. Repeat after a new order is placed to get the updated latest order's link.
**How found:** While placing an order, noticed the jQuery JSONP request for download link; tried stripping callback suffix, checkout_token, and cache-buster params and found response unchanged, then confirmed in incognito/other browsers and after new orders.
**Exploitation:** Attacker sends unauthenticated request with empty checkout_token and target shop name; server returns latest order's download link, which attacker can fetch to obtain the digital asset without paying.
**Insight:** JSONP endpoints that take a shop identifier and a token are worth testing with the token removed entirely—nil-token handling often falls back to a broad query (e.g. 'latest order') rather than erroring.

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

**Empty checkout_token request returns latest order download link**

```
https://delivery.shopifyapps.com/checkout/get_download_link?callback=jQuery&shop=superhacks.myshopify.com&checkout_token=`

In both Cases the response is the same
`jQuery({"ready":true,"links":[{"name":"PG000892.zip","product_name":"WILD WOLF","url":"https://superhacks.com/a/downloads/-/d6d6528fb49ed4d5/5fabe0193543d2cf","download_limit":2,"filesize":"3.07 MB"}]})
```

**Empty checkout_token check_order request confirms attachments**

```
https://delivery.shopifyapps.com/checkout/check_order?callback=jQuery&shop=superhacks.myshopify.com&checkout_token=`

produces:
`jQuery({"has_attachments":true,"is_downloadable":true})
```

