H1514 Stored XSS on Wholesale sales channel allows cross-organization data leakage
The price list CSV file name field was not escaped for a JavaScript context, so a stored cross-site scripting payload fired when the price list page was viewed. Because the wholesale domain is shared across shops, an attacker with the Apps permission could reach the Wholesale channel of any shop owned by a user who shares one shop with them.
- Triaged in 4 hours
- Fixed in 18 days
- Paid in 4 hours
- Disclosed after 13 months
Summary by the program
@cablej reported an XSS issue in the Wholesale Channel through the price_list[csv_file_name] parameter when importing a price list from a CSV. This value was not properly escaped for javascript context, and led to a stored XSS issue when visiting that price list.
The report
Summary:
There exists a stored XSS vulnerability via the Wholesale sales channel at https://wholesale.shopifyapps.com. This allows an attacker who shares one shop with an account owner to access the Wholesale sales channel of any shop belonging to the owner.
Steps To Reproduce:
- Visit https://wholesale.shopifyapps.com and add the Wholesale integration to your account.
- Navigate to the Wholesale sales channel at https://your-store.myshopify.com/admin/apps/wholesale.
- Navigate to create a new price list import.
- Modify the sample CSV file at https://help.shopify.com/manual/sell-online/wholesale/channel/price-lists-customers/import-prices/sample-csv-sku.csv to include the SKU of one of your shop's products.
- Upload the CSV file.
- After creating the price list, modify the price list and intercept the request to
POST /admin/shops/x/price_lists/x. - Modify the
price_list[csv_file_name]parameter to include an XSS payload, such assample-csv-sku.csv"-alert(document.domain)-". - Navigate back to the newly created price list. Observe that when visiting the page, the XSS payload will fire on the embedded domain
https://wholesale.shopifyapps.com:
{{media:0}}
- As this domain is shared across shops, this can be exploited to access the Wholesale information of any store a user has access to.
Impact
An attacker with the Apps permission who shares one shop with an owner of multiple stores (e.g. via Shopify partners) can exploit this vulnerability to gain access to the Wholesale sales channel of any shop belonging to the owner.
As stated when authenticating with Wholesale:
Wholesale will be able to access data such as customer names, e-mail addresses, phone numbers, physical addresses, geolocations, IP addresses, and browser user agents.
As a result, this allows access to extensive customer information, as well as the ability to modify any Wholesale information.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the CSV file name was written into a JavaScript context on the price list page without escaping, allowing a crafted value to break out and execute script.
Impact
An attacker with the Apps permission who shares one shop with an owner of multiple stores could access the Wholesale channel of any shop belonging to that owner, exposing customer data and allowing changes to Wholesale information.
What the attacker needed
Apps permission on a shared shop; Victim owns multiple shops; Victim opens the price list page
How it was found
- Add the Wholesale integration to the account and open the Wholesale sales channel.
- Start creating a new price list import.
- Edit the sample CSV so it contains the SKU of one of the shop's products, then upload it.
- After the price list is created, edit it and intercept the update request.
- Change the CSV file name parameter to an XSS payload.
- Open the price list page and observe the payload firing on the shared wholesale domain.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A price list import lets a shop owner upload a CSV file, and the file's name is shown again later on a page. The site put that name into the page without neutralising special characters, so a crafted name could run script in the browser of anyone who opened the page. Since the wholesale site is shared by many shops, that script could act on other shops the same person owns.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.