Skip to content
XSS Disclosed report Intermediate

Tinymce 2.4.0

A Shopify page loads a vulnerable version of TinyMCE, and an attacker can lure an admin into dragging HTML content from a malicious site onto the editor, causing TinyMCE to render it. The reporter could not achieve script execution, but demonstrated that arbitrary HTML can be rendered.

jelmer Follow

Originally disclosed on HackerOne

Bounty$2,000 Medium 4.8 View original
  • Triaged in 26 hours
  • Fixed in 34 days
  • Paid in 34 days
  • Disclosed after 35 days

Hello,

The following url

Loads https://cdn.shopify.com/s/assets/mobile_app/rte-bundle-f044a6c638b6c0500848c772dd5c86bf0eb2b27516c0860c6d3ddafde42231e2.js which is a minified tinymce 2.4.0.

This version of tinymce has known vulnerabilities but in order to trigger them the attacker needs access to tinymce's functionality. To achieve this I came up with a drag drop scenario which goes as follows:

  • Attacker lures Shopify admin to controlled website
  • Attacker convinces admin to drag element on the page which has an ondragstart prop with event.dataTransfer.setData+text/html mime (event.dataTransfer.setData('text/html', payload))
  • Immediatly after the drag the attacker redirects the user to Shopify. This does not violate the XFO 'DENY' setting (https://app.shopify.com//services/mobile_app/rte)
  • Victim releases the mouse button after loading the tinymce and the dragged data gets rendered by tinymce (tinymce is fullscreen so it doesn't matter where you drop it on the screen)

While I couldn't get a tinymce XSS to trigger it does illustrate an attacker can make tinymce render something. Underneath are the vulnerabilities I tried with associated payload.

XSS through a href data url

<a href="data:text/html;base64,PHNjcmlwdD5hbGVydCgiWFNTIik8L3NjcmlwdD4=" target="_blank">Firfox</a>

Filter confusion 1

'">><marquee><img src=x onerror=confirm(1)></marquee>"></plaintext\></|\><plaintext/onmouseover=prompt(1)>

Filter confusion 2 and here

<HTML xmlns: ><audio>
<audio src=wp onerror=alert(0X1)>

Filter confusion 3

&ltg;?">&ltg;iframe SRC=&#106&#97&#118&#97&#115&#99&#114&#105&#112&#116&#58&#97&#108&#101&#114&#116&#40&#39&#88&#83&#83&#39&#41>?>

While unable to create a proper PoC the availability of the vulnerable library presented in the way it is might be of your interest.

Here is the poc:

<div draggable="true" ondragstart="event.dataTransfer.setData('text/html', '<img src=\'https://cdn.shopify.com/shopify-marketing_assets/static/shopify-favicon.png\'/>'); document.location='https://app.shopify.com//services/mobile_app/rte'">drag</div>

Save that as a html file, open with firefox, drag the div and release it after the page redirected. Tinymce will then render the favicon.

Considering the things that live under this subdomain + CSRF token handout on page successful exploitation of this could get pretty disastrous.

The original report as published on HackerOne, by jelmer. 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 outdated TinyMCE version does not properly sanitise HTML content inserted via drag-and-drop, allowing arbitrary HTML to be rendered.

Impact

An attacker could render arbitrary HTML in the context of the Shopify admin page, and combined with other factors this could be disastrous, though the reporter did not achieve script execution.

What the attacker needed

Victim is a Shopify admin; victim drags an element from attacker site; victim releases mouse after redirect

The fix

The vulnerable TinyMCE library could be updated to a patched version.

How it was found

  1. Attacker lures a Shopify admin to a controlled website.
  2. Attacker convinces the admin to drag an element that sets HTML data in the drag event.
  3. Immediately after the drag starts, the attacker redirects the user to the Shopify TinyMCE page.
  4. The victim releases the mouse button after the TinyMCE page loads, and the dragged data is rendered by TinyMCE.

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.

TinyMCE is a text editor used in web pages. The report shows that if someone drags content from another website into the editor, the editor will display that content. The author tried to make it run harmful code but did not succeed; they only proved that content can be injected.

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 jelmer

View all

1 more disclosed report, 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.