xss triggered in "myshopify.com/admin/product"
The HTML sanitisation function in the Products Rich Text Editor could be bypassed, allowing JavaScript to be injected into a product description.
Originally disclosed on HackerOne
- Triaged in 40 hours
- Fixed in 5 days
- Paid in 6 days
- Disclosed after 6 days
Summary by the program
@jaka_tingkir discovered a bypass to an HTML sanitization function on the Collections and Products Rich Text Editor. Until recently, all reports regarding cross site scripting in the Rich Text Editor were considered a Known Issue under our program:
- XSS - Rich Text Editor - Any issue related to execution of javascript in the Rich Text Editor (for example, when editing the description of a product, blog or collection, etc).
Recently we deployed an HTML sanitization function to the Rich Text Editor in specific sections of the administrative area. We then updated the exclusion to mention specific pages that are still vulnerable:
- XSS - Rich Text Editor - Issues relating to execution of JavaScript in the legacy Rich Text Editor in the Legal settings, Blogs section, and Pages section of the Shopify admin.
As this exclusion states, all new reports regarding the legal settings, blogs, and pages sections will still be considered invalid and a Known Issue. New XSS reports regarding the rich text editors in the Products and Collections sections may be valid.
The report
I tried to make a product description and add the xss script in the paragraph.
steps for reproduction
- create a new product
- enter xss in the product description paragraph, such as;
`<div align =" center "data-mce-fragment =" 1 "> <img src = x onerror = prompt (document.cookie)>
<h4 dir = "ltr" data-mce-fragment = "1"> <span style = "text-decoration: underline; color: # ff2a00;"> <em> <strong> (name_product) </strong></em></span> </h4> </div> ``Impact
xss can be triggered
Attachments
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 HTML sanitisation function did not properly filter out dangerous attributes or tags, allowing an attacker to inject executable JavaScript through the product description editor.
Impact
An attacker could trigger cross-site scripting through the product description editor.
What the attacker needed
Access to Shopify admin; ability to create or edit a product
How it was found
- Create a new product.
- Enter a crafted XSS payload in the product description paragraph.
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 rich text editor is a tool for formatting text, like making words bold or adding images. The security filter meant to stop harmful code was not strong enough, so a user could sneak in a script that runs in the browser of anyone who views the product description. This kind of attack is called cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.