Skip to content
XSS Disclosed report Intermediate

Bypass Filter and get Stored Xss

Shopify's SVG navigation icon upload for Sales Channel apps failed to enforce its element/attribute whitelist when the SVG contained an XML entity, allowing a developer to include an onload handler. This enabled stored XSS on partners.shopify.com and the admin panel of any shop that authorised the sales channel.

dr_dragon Follow

Originally disclosed on HackerOne

Bounty$3,000 High 8.1 View original
  • Triaged in 1 hour
  • Fixed in 12 months
  • Paid in 2 months
  • Disclosed after 12 months

Description

Shopify allows developers to create a special type of application called a "Sales Channel". Developers are allowed to upload a 16x16 SVG "Navigation Icon" for their app provided the SVG follows the design guidelines which limits the allowed elements and attributes. For some reason when the SVG contains an XML entity this whitelist is no longer enforced allowing the developer to include malicious attributes such as onload. By uploading a malicious SVG a developer can obtain XSS on both partners.shopify.com, as well as any the admin panel of any shop which has authorized the sales channel.

Proof of Concept

This is relatively easy to reproduce, first create a new application within the Partners dashboard then navigate to "Extensions" -> "Sales channel" to convert the application. After saving those changes a new field within the "App info" section titled "Navigation icon". Upload the following SVG:

<svg><!--?php "--><script>confirm(20)</script>?&gt;</svg>

Impact

An attacker can use XSS to send a malicious script to an unsuspecting user. The end user’s browser has no way to know that the script should not be trusted, and will execute the script. Because it thinks the script came from a trusted source, the malicious script can access any cookies, session tokens, or other sensitive information retained by the browser and used with that site. These scripts can even rewrite the content of the HTML page. For more details on the different types of XSS flaws

Attachments

xss.JPG
xss.JPG From the original on HackerOne

The original report as published on HackerOne, by dr_dragon. 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 SVG sanitiser's whitelist was bypassed because the presence of an XML entity caused the parser to skip validation of elements and attributes.

Impact

An attacker could execute arbitrary script in the browser of a Shopify partner or shop admin, potentially accessing cookies, session tokens, and other sensitive information.

What the attacker needed

A Shopify Partner account; ability to create a Sales Channel app; victim views the malicious icon

How it was found

  1. Create a new application in the Partners dashboard.
  2. Navigate to Extensions -> Sales channel to convert the application.
  3. Save the changes and open the App info section to find the Navigation icon field.
  4. Upload an SVG containing an XML entity and a script payload.

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 sales channel app lets a developer add a small icon that appears in Shopify's admin. The site tried to block dangerous parts of the icon file, but a quirk in how it read the file let a script slip through. When an admin viewed the icon, the script ran in their browser and could steal their session.

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 dr_dragon

View all

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