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.
- 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.
<a href="data:text/html;base64,PHNjcmlwdD5hbGVydCgiWFNTIik8L3NjcmlwdD4=" target="_blank">Firfox</a>
'">><marquee><img src=x onerror=confirm(1)></marquee>"></plaintext\></|\><plaintext/onmouseover=prompt(1)>
<HTML xmlns: ><audio>
<audio src=wp onerror=alert(0X1)>
<g;?"><g;iframe SRC=javascript:alert('XSS')>?>
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.
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
- Attacker lures a Shopify admin to a controlled website.
- Attacker convinces the admin to drag an element that sets HTML data in the drag event.
- Immediately after the drag starts, the attacker redirects the user to the Shopify TinyMCE page.
- 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.