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!
The Shopify Digital Downloads app's endpoint returned the most recent order's download links when the checkout_token parameter was empty, instead of rejecting the request. An attacker could retrieve and download paid digital assets from the latest order placed by any customer on the store.
- Triaged in 9 hours
- Fixed in 5 days
- Paid in 5 days
- Disclosed after 7 months
Summary by the program
A report from @superbsic showed that it was possible to download the latest digital purchased order attachment for stores that have the Digital download app installed, by setting the checkout_token to be empty. The issue was that when the checkout_token was nil, we would return all orders and select the latest order from the list.
Our team immediately deployed a change to address this issue. We resolved the issue by validating the checkout_token before fetching an order.
The report
Please Note: I found this bug on a website made using Shopify
I tried doing the same with my Shopify store but I was not able to buy anything as it was required to add credit card details which I don't have :(
THE LINKS GIVEN AS THE EXAMPLE ARE NOT VALID LINKS BUT THE BUG WORKS ON EVERY SHOPIFY STORE THAT USES THE SAME LOGIC!!
I have blurred the name of the website where I found the bug in the images as well SO THE NAME IN THE BELOW REPORT IS CHANGED SUPERSHACKS(my store) = SOMERANDOMWEBSITE.COM(The website I tested on or every other Shopify store that makes a jQuery request to check and get the download link)
jQuery request for Downloading Digital assets exposes download link even without Checkout Id, Callback Id. Produces the Most recent order for anyone to view!!
ONCE A NEW ORDER IS PLACED, THE LINK UPDATES AUTOMATICALLY
This is bug regarding a Shopify Digital Assets/products store and probably Applies to every Digital asset/products website made with Shopify out there
this is while I was placing an order and was messing around.
Note SUPERHACKS is MYown shopify website and is not live! So replace "superhacks" with "the website you want to test"
Now when I place the order, A GET request is made for downloading the asset
GET /checkout/get_download_link?callback=jQuery22009741786286098322_1606361688834&shop=superhacks.myshopify.com&checkout_token=1c0869d74100cd3582916a93a4bce741&_=1606361688835 HTTP/1.1 Host: delivery.shopifyapps.com
okay cool I Tried messing around and found out that removing everything i.e.
- The nos. after jQuery
22009741786286098322_1606361688834 - and even the Checkout Token!!
1c0869d74100cd3582916a93a4bce741 - And the underscore part at the end of the URL
&_=1606361688835
This is the URL (let's call it filled Link) Filled Link:
https://delivery.shopifyapps.com/checkout/get_download_link?callback=jQuery22009741786286098322_1606361688834&shop=superhacks.myshopify.com&checkout_token=1c0869d74100cd3582916a93a4bce741&_=1606361688835
After removing the above mentioned part the URL looks like this (let's call it Unfilled Link) Unfilled 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"}]})
After removing these, the request still produced my order!
Same Is The Case while the CHECK ORDER REQUEST IS MADE
Filled Link:
https://delivery.shopifyapps.com/checkout/check_order?callback=jQuery22009741786286098322_1606361688834&shop=superhacks.myshopify.com&checkout_token=1c0869d74100cd3582916a93a4bce741&_=1606361688835
produces this:
jQuery22009741786286098322_1606361688834({"has_attachments":true,"is_downloadable":true})
Unfilled Link:
https://delivery.shopifyapps.com/checkout/check_order?callback=jQuery&shop=superhacks.myshopify.com&checkout_token=
produces:
jQuery({"has_attachments":true,"is_downloadable":true})
confirming there are attachements in the request made
I thought It may be due to Some cookies stored locally... BUT NO.... I tried it in incognito, Firefox, Chrome!! (Check Attached Images) It still gave the EXACT same response which is:
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"}]})
I placed a new order and the Unfilled link's request got updated with the new order download link!!
This could lead an attacker simply getting every possible download link of the most recent order placed!!!
I think the request is not validated at the server and it stores the most recent order placed in the Unfilled link part. But this is major flaw if this logic is being used widely at every Shopify store
STEPS TO REPRODUCE::
- Find a website that sells digital assets and is made using Shopify and uses the same default Shopify logic
https://delivery.shopifyapps.com/checkout/check_order?callback=jQuery&shop=**superhacks**.myshopify.com&checkout_token=REPLACE "superhacks" with THE STORE NAME YOU WANT TO TEST.- And That's it... whenever an order is placed, You will get the link in the following format
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"}]})IT HAS THE DOWNLOAD LINK (URL PART)!!
SAME IS THE CASE WHEN ANY PRODUCT IS ORDERED BY ONE USER, EVERYONE CAN ACCESS/DOWNLOAD IT I tried it doing it with another product and it worked!
Thank you Regards Adarsh
Impact An attacker could achieve download links for every order placed on the website by looping the URL and the URL would produce the MOST RECENT ORDER!
Impact
Anyone Can Download/see/check the latest order placed by someone on the website....
Essentially both anyone can download the files Ordered by someone else for himself!
Context
The target is the Shopify Digital Downloads app, served from delivery.shopifyapps.com. Stores built on Shopify that sell digital assets use this app to hand buyers their files after checkout. The storefront makes jQuery JSONP-style calls to two endpoints on that host: one to check whether an order has downloadable attachments, and one to fetch the actual download links.
The normal flow is: a buyer completes checkout, the storefront calls check_order to learn whether the order has attachments, then calls get_download_link with the order's checkout_token to obtain the file URLs. The checkout_token is what ties a request to a specific order.
The researcher stresses that the example links in the report are not valid, and claims the bug works on every Shopify store that uses the same logic. The store name in the examples is a placeholder: superhacks stands for the store being tested, and the site where the bug was originally found has its name blurred in the screenshots.
Setup
The researcher was placing an order on a Shopify store when they started poking at the requests. They note that they could not buy anything on their own Shopify store because checkout required credit card details they did not have.
No special tooling is described beyond a browser and its developer tools. The researcher explicitly tested in incognito mode, Firefox and Chrome to rule out locally stored cookies as the cause.
Finding it
While placing an order, the researcher observed a GET request being made to fetch the download link:
GET /checkout/get_download_link?callback=[redacted]&shop=superhacks.myshopify.com&checkout_token=[redacted]&_=1606361688835 HTTP/1.1
Host: delivery.shopifyapps.com
The URL has four parts that look like they matter: the jQuery callback name with its numeric suffix, the shop parameter identifying the store, the checkout_token identifying the order, and a cache-busting _ parameter. The researcher began removing them one at a time.
Exploitation
Step 1: capture the filled link
The full URL, which the researcher calls the filled link, is:
https://delivery.shopifyapps.com/checkout/get_download_link?callback=[redacted]&shop=superhacks.myshopify.com&checkout_token=[redacted]&_=1606361688835
This is the request the storefront makes on behalf of a legitimate buyer.
Step 2: strip the callback suffix, the token and the cache buster
The researcher removed the numbers after jQuery (22009741786286098322_1606361688834), the checkout token ([redacted]) and the trailing underscore parameter (&_=1606361688835). The result, the unfilled link, is:
https://delivery.shopifyapps.com/checkout/get_download_link?callback=jQuery&shop=superhacks.myshopify.com&checkout_token=
The checkout_token parameter is left present but empty. The shop parameter is the only thing still identifying anything.
Step 3: compare the responses
Both the filled and the unfilled link returned the same body:
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"}]})
The response contains the file name, the product name, a download URL, a download limit and a file size. The callback name in the response matches the callback in the request, so the shortened jQuery callback is reflected back.
Step 4: repeat against the check endpoint
The same behaviour appears on the companion endpoint. The filled link:
https://delivery.shopifyapps.com/checkout/check_order?callback=[redacted]&shop=superhacks.myshopify.com&checkout_token=[redacted]&_=1606361688835
returns:
[redacted]({"has_attachments":true,"is_downloadable":true})
The unfilled link:
https://delivery.shopifyapps.com/checkout/check_order?callback=jQuery&shop=superhacks.myshopify.com&checkout_token=
returns:
jQuery({"has_attachments":true,"is_downloadable":true})
This confirms that the order is treated as having attachments even with no token supplied.
Step 5: rule out cookies
The researcher suspected the result might come from cookies stored locally, so they repeated the request in incognito mode, in Firefox and in Chrome. The response was exactly the same each time:
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"}]})
No session state is needed.
Step 6: place a new order and watch the link change
After placing a new order, the unfilled link's response was updated with the new order's download link. The researcher also tried a different product and it worked the same way. The unfilled link therefore always reflects the most recent order placed on the store, whoever placed it.
Steps to reproduce (as given)
- Find a website that sells digital assets and is built on Shopify, using the same default Shopify logic.
- Request:
https://delivery.shopifyapps.com/checkout/check_order?callback=jQuery&shop=superhacks.myshopify.com&checkout_token=
replacing superhacks with the store name to test.
3. Whenever an order is placed, the response contains the download link in the format shown above, including the URL part.
The researcher notes that the same applies when any product is ordered by one user: everyone can access and download it.
Root cause
According to the program's summary, the flaw was that when the checkout_token was nil, the backend returned all orders and selected the latest one from the list. The token was not validated before an order was fetched, so an empty token returned all orders and the latest one was selected.
The researcher's own reading was that the request was not validated at the server and that the most recent order was stored behind the unfilled link. The program's summary confirms the mechanism: a nil token leads to returning all orders and selecting the latest.
Impact
An attacker who knows a store's myshopify.com handle can request the unfilled link and receive the download URL for the most recent order placed on that store, without any authentication or session. The researcher describes looping the URL so that it keeps producing the most recent order, and notes that anyone can download files ordered by someone else.
The unfilled link returns the most recent order at any given moment, on stores that sell digital assets through this app and use the same logic. The researcher hedges that the bug probably applies to every digital asset store built on Shopify, and that it is a major flaw if the logic is used widely.
Fix
Shopify deployed a change immediately. The program states that the issue was resolved by validating the checkout_token before fetching an order, so a nil or empty token no longer falls through to a query that returns all orders.
Variants to test
- Empty versus missing parameter. Try
checkout_token=and also removing the parameter entirely on similar JSONP endpoints. A positive result is a response containing order data rather than an error or an empty list. - Other identifier parameters. On endpoints that take an order, cart or session identifier, blank the value and see whether the backend falls back to a default or latest record. A positive result is data belonging to an order you did not create.
- Callback reflection. The callback parameter is reflected verbatim in the response. Check whether arbitrary callback values are accepted, which would matter if the endpoint ever returns sensitive data cross-origin.
- Companion endpoints. The
check_orderendpoint leaked the same way asget_download_link. When you find one leaking endpoint, test the sibling endpoints used by the same frontend flow. - Fresh order timing. Place an order (or observe one being placed) and immediately re-request the unfilled link. A positive result is the response updating to the new order's file.
Hunting notes
This kind of bug hides in small JSONP helper endpoints that a storefront calls after checkout, especially on shared app infrastructure where one host serves many stores and the store is selected by a shop parameter. During recon, watch the network tab on a checkout or post-purchase page for calls to a different host than the store itself, and note which parameters look like identifiers. The signal is a parameter whose removal or blanking still returns data.
The researcher showed the same response across incognito, Firefox and Chrome, showed the response change after a new order was placed, and reproduced it with a second product.
A note on the report itself: the researcher could not complete a purchase on their own store because checkout required card details.
What happened, in plain words
Shopify is a platform that lets people build online shops. Many of those shops sell digital products: files such as zip archives that a buyer downloads after paying, rather than a parcel that arrives in the post. To hand those files over, Shopify provides an app called Digital Downloads, and the files are served from a Shopify host called delivery.shopifyapps.com.
When a buyer finishes checkout, the shop's web page quietly asks that host two questions. First: does this order have any files attached? Second: if so, what are the download links? The page asks these questions using small web requests, and it includes a piece of text called a checkout_token so the server knows which order it is talking about. Think of the token as the claim ticket you get at a cloakroom: you hand it in, and you get back the coat that belongs to that ticket.
The researcher found that if you send the same request but leave the claim ticket blank, the server does not refuse. Instead it hands back the download link for the most recent order placed on that shop. Anyone who knows the shop's name can do this from a normal browser, with no account and no purchase. The program confirmed the cause: when the token was empty, the server returned all orders and picked the latest one.
Context
The target is the Shopify Digital Downloads app, served from delivery.shopifyapps.com. Shops built on Shopify that sell digital assets use this app to give buyers their files after checkout. The shop's page makes jQuery JSONP-style calls to two endpoints on that host: one to check whether an order has downloadable attachments, and one to fetch the actual download links.
A few of those words need unpacking before anything else makes sense.
- An endpoint is a specific address on a server that answers a specific kind of request. It is like a particular counter in a large office: the building address gets you inside, but the counter decides what you can ask for. Here the two counters are
/checkout/check_orderand/checkout/get_download_link. - An API is the general name for a set of such counters that one piece of software uses to talk to another. The shop's web page is one program; the download service is another; the API is the agreed menu of questions the page is allowed to ask.
- jQuery is a widely used JavaScript library, a bundle of ready-made code that web pages load to do common jobs, including asking a server for data without reloading the page.
- JSONP is an old technique for getting data from a different domain than the one the page came from. Browsers normally block a page from reading responses from another site, a rule called the same-origin policy. JSONP gets around this by asking the server to wrap its answer in a JavaScript function call, whose name the page supplies in a
callbackparameter. The browser then treats the reply as a script to run rather than as data to read, and running a script from another domain is allowed. The price is that the server echoes back whatever function name you give it. - A GET request is the simplest kind of web request: the browser asks a server for something by putting all the details in the address itself. Typing a web address into the bar and pressing Enter is a GET request.
- A parameter (also called a query parameter) is one of the labelled values after the
?in an address, written asname=valueand separated by&. In?shop=superhacks.myshopify.com&checkout_token=abc, there are two parameters:shopandcheckout_token. - A token is a long random-looking string that stands in for something secret, here a particular order. It is not a password, but it plays the same role as one in this flow: whoever holds the right token is treated as entitled to that order's files.
- A cookie is a small piece of data a website stores in your browser so it can recognise you on the next request. It is how a shop remembers that you are logged in.
- Incognito mode (private browsing) is a browser mode that starts with no stored cookies and throws away anything it collects when you close the window. It is the standard quick test for whether a result depends on something saved in your browser.
- Cache busting is the practice of adding a meaningless changing value to an address so that neither the browser nor any server in between serves an old saved copy. The
_parameter with a long number is exactly that: a value that changes every time so the request always looks new.
The normal flow is: a buyer completes checkout, the shop's page calls check_order to learn whether the order has attachments, then calls get_download_link with the order's checkout_token to obtain the file URLs. The checkout_token is what ties a request to a specific order.
The researcher stresses that the example links in the report are not valid, and that the bug works on every Shopify shop that uses the same logic. The shop name in the examples is a placeholder: superhacks stands for the shop being tested, and the site where the bug was originally found has its name blurred in the screenshots. The researcher also notes that they could not buy anything on their own Shopify shop because checkout required credit card details they did not have.
Setup
The researcher was placing an order on a Shopify shop when they started poking at the requests. They note that they could not reproduce the purchase on their own Shopify shop because checkout required credit card details they did not have.
No special tooling is described beyond a browser and its developer tools. The researcher explicitly tested in incognito mode, Firefox and Chrome to rule out locally stored cookies as the cause.
If you want to follow along on your own machine, the only skill needed is opening the developer tools in your browser (usually with F12, or right-click then Inspect) and clicking the Network tab. Every request the page makes appears there as a row, and clicking a row shows the full address and the response. That is the entire toolkit used here.
Finding it
While placing an order, the researcher observed a GET request being made to fetch the download link:
GET /checkout/get_download_link?callback=[redacted]&shop=superhacks.myshopify.com&checkout_token=[redacted]&_=1606361688835 HTTP/1.1
Host: delivery.shopifyapps.com
Line by line:
GET /checkout/get_download_link?... HTTP/1.1is the request line.GETis the method, the part after it is the path and all the parameters, andHTTP/1.1is the version of the web protocol being spoken. The path/checkout/get_download_linkis the counter being asked: give me the download link.callback=[redacted]is the JSONP function name. jQuery generates a long unique name each time so that two replies arriving at once cannot be confused. The number after the underscore is a timestamp, which makes the name unique per call.shop=superhacks.myshopify.comsays which shop the request is about. Every Shopify shop has amyshopify.comaddress like this, even if it also has a nicer custom domain.checkout_token=[redacted]is the claim ticket for the order. This is the parameter that is supposed to limit the answer to one buyer's order._=1606361688835is the cache buster, another timestamp, there only to stop anything from serving a stale copy.Host: delivery.shopifyapps.comis a header, a line of extra information sent with the request. It tells the server which site name the browser was aiming at, because one server can answer for many names.
The URL has four parts that look like they matter: the jQuery callback name with its numeric suffix, the shop parameter identifying the shop, the checkout_token identifying the order, and a cache-busting _ parameter. The researcher began removing them one at a time. The reasoning is simple: each parameter is a lock, and the way to find out whether a lock is actually doing anything is to take it off and see if the door still opens.
Exploitation
Step 1: capture the filled link
The full URL, which the researcher calls the filled link, is:
https://delivery.shopifyapps.com/checkout/get_download_link?callback=[redacted]&shop=superhacks.myshopify.com&checkout_token=[redacted]&_=1606361688835
This is the request the shop's page makes on behalf of a legitimate buyer. It is the baseline: the version that is known to work correctly, saved so that any later shortened version can be compared against it. Without a baseline you cannot tell whether a strange reply is a bug or just what the service always says.
Step 2: strip the callback suffix, the token and the cache buster
The researcher removed the numbers after jQuery (22009741786286098322_1606361688834), the checkout token ([redacted]) and the trailing underscore parameter (&_=1606361688835). The result, the unfilled link, is:
https://delivery.shopifyapps.com/checkout/get_download_link?callback=jQuery&shop=superhacks.myshopify.com&checkout_token=
The checkout_token parameter is left present but empty. The shop parameter is the only thing still identifying anything.
Why leave the parameter in at all rather than delete it? Because the two cases can behave differently. A server may treat a missing parameter as an error and an empty one as a value, and an empty value is often what slips through checks. Here the researcher chose the empty form, and it is the form that worked.
Step 3: compare the responses
Both the filled and the unfilled link returned the same body:
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"}]})
Reading the reply:
jQuery(and the closing)are the JSONP wrapper. The server took the callback name from the request and wrapped its answer in a call to that name. Because the request saidcallback=jQuery, the reply saysjQuerytoo. The server is echoing back whatever name it was given."ready":truesays the service is ready and the answer is complete."links":[ ... ]is a list of downloadable files. The square brackets mean a list, and here it holds one entry."name":"PG000892.zip"is the file name."product_name":"WILD WOLF"is the name of the product the file belongs to."url":"https://superhacks.com/a/downloads/-/d6d6528fb49ed4d5/5fabe0193543d2cf"is the actual download address. This is the valuable part: anyone holding this address can fetch the file."download_limit":2says how many times the file may be downloaded."filesize":"3.07 MB"is the size of the file.
The important observation is that the reply to the unfilled link is identical to the reply to the filled link. The token made no difference. The claim ticket was blank and the coat still came out.
Step 4: repeat against the check endpoint
The same behaviour appears on the companion endpoint. The filled link:
https://delivery.shopifyapps.com/checkout/check_order?callback=[redacted]&shop=superhacks.myshopify.com&checkout_token=[redacted]&_=1606361688835
returns:
[redacted]({"has_attachments":true,"is_downloadable":true})
The unfilled link:
https://delivery.shopifyapps.com/checkout/check_order?callback=jQuery&shop=superhacks.myshopify.com&checkout_token=
returns:
jQuery({"has_attachments":true,"is_downloadable":true})
This confirms that the order is treated as having attachments even with no token supplied.
In the first reply, the wrapper is the long generated name [redacted], matching the callback in the request. In the second, it is the short jQuery. Inside, "has_attachments":true means the order has files attached, and "is_downloadable":true means those files can be downloaded. Both are true even though no order was identified.
Why test this second endpoint at all? Because the two endpoints are part of one flow and are likely built from the same code. If one forgets to check the token, its neighbour probably does too. Finding the same mistake twice turns a single odd reply into a pattern, and a pattern is much harder for a program to dismiss as a fluke.
Step 5: rule out cookies
The researcher suspected the result might come from cookies stored locally, so they repeated the request in incognito mode, in Firefox and in Chrome. The response was exactly the same each time:
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"}]})
No session state is needed.
The reasoning matters here. If the answer only appeared because the researcher's own browser was still logged in as the buyer, then the bug would be harmless: it would only show you your own order. Testing in a fresh incognito window removes all saved cookies, and testing in two different browsers removes the chance that one browser's storage is doing something unusual. Getting the same answer in all three means the server is producing it on its own, for anyone who asks.
Step 6: place a new order and watch the link change
After placing a new order, the unfilled link's response was updated with the new order's download link. The researcher also tried a different product and it worked the same way. The unfilled link therefore always reflects the most recent order placed on the shop, whoever placed it.
This is the step that shows what the blank token actually does. It does not return some fixed old record; it follows whatever order was placed last. The researcher describes looping the URL so that it keeps producing the most recent order, which means an attacker does not need to guess anything: they just keep asking and pick up each new order as it arrives.
Steps to reproduce (as given)
- Find a website that sells digital assets and is built on Shopify, using the same default Shopify logic.
- Request:
https://delivery.shopifyapps.com/checkout/check_order?callback=jQuery&shop=superhacks.myshopify.com&checkout_token=
replacing superhacks with the shop name to test.
3. Whenever an order is placed, the response contains the download link in the format shown above, including the URL part.
The researcher notes that the same applies when any product is ordered by one user: everyone can access and download it.
Root cause
According to the program's summary, the flaw was that when the checkout_token was nil, the backend returned all orders and selected the latest one from the list. The token was not validated before an order was fetched, so an empty token returned all orders and the latest one was selected.
"Fail closed" is worth explaining, because it is the heart of the mistake. A check that fails closed refuses access when something is wrong: no ticket, no coat. A check that fails open lets the request through when the input is missing or malformed. Here the code was written as though a token would always be present, so when it was not, the filter that should have narrowed the search to one order simply was not applied. The database then answered with every order, and the code took the first or newest one from that list.
The researcher's own reading was that the request was not validated at the server and that the most recent order was stored behind the unfilled link. The program's summary confirms the mechanism: a nil token leads to returning all orders and selecting the latest.
Impact
An attacker who knows a shop's myshopify.com handle can request the unfilled link and receive the download URL for the most recent order placed on that shop, without any authentication or session. The researcher describes looping the URL so that it keeps producing the most recent order, and notes that anyone can download files ordered by someone else.
The unfilled link returns the most recent order at any given moment, on shops that sell digital assets through this app and use the same logic. The researcher hedges that the bug probably applies to every digital asset shop built on Shopify, and that it is a major flaw if the logic is used widely.
In everyday terms: a shop's myshopify.com handle is public, printed in its address and visible to anyone who visits. So the only thing an attacker needs is something the shop advertises openly.
Fix
Shopify deployed a change immediately. The program states that the issue was resolved by validating the checkout_token before fetching an order, so a nil or empty token no longer falls through to a query that returns all orders.
Variants to test
These are the general lessons to carry to other targets, written as things to try rather than things that were confirmed here.
- Empty versus missing parameter. Try
checkout_token=and also removing the parameter entirely on similar JSONP endpoints. A positive result is a response containing order data rather than an error or an empty list. - Other identifier parameters. On endpoints that take an order, cart or session identifier, blank the value and see whether the backend falls back to a default or latest record. A positive result is data belonging to an order you did not create.
- Callback reflection. The callback parameter is reflected verbatim in the response. Check whether arbitrary callback values are accepted, which would matter if the endpoint ever returns sensitive data cross-origin.
- Companion endpoints. The
check_orderendpoint leaked the same way asget_download_link. When you find one leaking endpoint, test the sibling endpoints used by the same frontend flow. - Fresh order timing. Place an order (or observe one being placed) and immediately re-request the unfilled link. A positive result is the response updating to the new order's file.
Hunting notes
This kind of bug hides in small JSONP helper endpoints that a shop's page calls after checkout, especially on shared app infrastructure where one host serves many shops and the shop is selected by a shop parameter. During recon, watch the network tab on a checkout or post-purchase page for calls to a different host than the shop itself, and note which parameters look like identifiers. The signal is a parameter whose removal or blanking still returns data.
"Recon" here just means looking around before testing: opening the network tab, reading the addresses, and noting which ones go somewhere other than the shop you are on. A request to a different host is interesting because that host is shared by many shops, so a mistake there affects all of them at once.
The researcher showed the same response across incognito, Firefox and Chrome, showed the response change after a new order was placed, and reproduced it with a second product.
A note on the report itself: the researcher could not complete a purchase on their own shop because checkout required card details.
Glossary
- API: the agreed set of requests one program can make to another, like a menu of questions a service will answer.
- Cache busting: adding a changing value to an address so no browser or server serves an old saved copy.
- Callback: in JSONP, the name of the JavaScript function the page wants the server to wrap its answer in.
- Checkout token: a long random string that identifies one particular order, used so the server knows whose files to return.
- Cookie: a small piece of data a site stores in your browser so it can recognise you on later requests.
- Endpoint: one specific address on a server that answers one specific kind of request.
- Fail closed / fail open: a check that refuses access when input is wrong fails closed; one that lets the request through fails open.
- GET request: a web request that puts all its details in the address, like typing a URL into the browser bar.
- Header: an extra line of information sent alongside a request or response, such as
Host. - Incognito mode: a browser mode that starts with no saved cookies and discards what it collects when closed.
- jQuery: a widely used JavaScript library that web pages load to do common tasks, including fetching data without reloading.
- JSONP: a technique for fetching data across domains by having the server wrap its reply in a function call named by the page.
- myshopify.com handle: the built-in address every Shopify shop has, such as
superhacks.myshopify.com, visible to anyone. - Parameter: a labelled value in an address after the
?, writtenname=valueand separated by&. - Recon: looking around a target before testing, for example reading the requests a page makes.
- Same-origin policy: the browser rule that stops a page from reading responses from a different site.
- Token: a long random string that stands in for something secret, here a specific order.
- Vulnerability class: the general category a bug belongs to, which helps you recognise the same mistake elsewhere.