Skip to content
XSS Disclosed report Intermediate

[h1-2102] HTML injection in packing slips can lead to physical theft

A HTML injection in the customer e-mail field of packing slips allows a customer to alter the printed slip, potentially changing the quantity of items shipped. An attacker could receive more items than paid for, causing financial loss to the store.

intidc Follow

Originally disclosed on HackerOne

Bounty$900 Low 3.7 View original
  • Triaged in 3 days
  • Fixed in 15 days
  • Paid in 6 days
  • Disclosed after 17 months

Summary:

A HTML injection vulnerability exists in the packing slip generator, allowing customers to alter the logistical process of their and other's orders for shops that choose to display the user's e-mail address on the packing slip. The success rate depends on the shops setup and can result in financial losses for the affected stores.

###Background - how stores use the packing slip Once an order comes in, the packing slips and shipping labels get printed to be processed. From my understanding, when preparing orders, logistical teams don't go back and forth between the Shopify orders, but print the packing slips in bulk (hence the new ability to print in bulk), fill the boxes in the warehouse with whatever is on the packing slip, put on a shipping label on the box and send it off. Should the customer be able to alter these packing slips upon printing, it could be possible to alter what (and how many) items will be in their box. It is observed that this is possible using some CSS tweaks and a HTML injection in the e-mail field.

Prerequisites

  • You'll need a store with a product that you can order. You can either work with a bogus payment gateway, or set the price of the product to 0 and mark it as a non-physical good so there's no shipping costs involved.

Steps To Reproduce:

  • Go to admin > delivery and set a packing slip template that displays the user's e-mail address in the billing / checkout info. You can use the one in the attachment (packingslip.txt). The example should look like this:
Screenshot_2021-01-25_at_23.46.30.png
Screenshot_2021-01-25_at_23.46.30.png From the original on HackerOne
  • As a customer, go to the store and check out the item. Buy only one, we'll alter the amount through this bug as a PoC.
Screenshot_2021-01-26_at_00.30.51.png
Screenshot_2021-01-26_at_00.30.51.png From the original on HackerOne
  • Enter the following e-mail (yes, this is a valid e-mail address, see RFC3696):

"<style>.flex-line-item-quantity>p{font-size:0}.flex-line-item-quantity:after{content:'1337\0000a0of\0000a01337';margin-left:420px;}</style>"@gmail.com

Screenshot_2021-01-26_at_00.31.16.png
Screenshot_2021-01-26_at_00.31.16.png From the original on HackerOne
  • Complete your order:
Screenshot_2021-01-26_at_00.31.27.png
Screenshot_2021-01-26_at_00.31.27.png From the original on HackerOne
  • You're done! Now wait and profit!

From the shop employee's perspective, go to orders. You have a new order, yay!

Free product has been ordered one time. Great! Let's print the packing slip (in big stores this would be printed in bulk, so people wouldn't really notice anything):

Screenshot_2021-01-26_at_00.45.53.png
Screenshot_2021-01-26_at_00.45.53.png From the original on HackerOne

Notice that the packing slip looks like this:

Screenshot_2021-01-26_at_00.46.37.png
Screenshot_2021-01-26_at_00.46.37.png From the original on HackerOne

Seems like the logistics team will be shipping 1337 items in instead of 1. We only paid for 1. We could also alter other stuff, like the actual item, or when printed in bulk, we could alter other people's packing slip. The sky is the limit! This won't work for all shops, but when it does, the impact will be very effective.

Impact

  • Literally steal goods
  • Alter other people's stuff as well if they use the bulk printer (e.g. add a special note, put your return address on the slip instead of the shop's, etc...)

The original report as published on HackerOne, by intidc. 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 packing slip template inserts the user-supplied e-mail address into HTML without proper escaping, allowing HTML and CSS injection.

Impact

An attacker could steal goods by altering the packing slip to show a higher quantity, and could also alter other customers' slips when printed in bulk, causing financial loss to the store.

What the attacker needed

A store with a product to order; packing slip template shows customer e-mail; ability to place an order

How it was found

  1. Set a packing slip template that displays the user's e-mail address.
  2. As a customer, order a single item.
  3. Enter an e-mail address containing HTML and CSS that alters the quantity display.
  4. Complete the order.
  5. Print the packing slip and observe the altered quantity.

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.

When a shop prints a packing slip, it includes the customer's e-mail address. If the shop doesn't clean that e-mail properly, a customer can put special code in it that changes how the slip looks when printed. This could trick the warehouse into sending more items than the customer paid for.

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 intidc

View all

5 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.