jmix
jmix copied to clipboard
[Port to 1.x] GrapesJsNewsletterHtmlEditor produces HTML with JavaScript code that can be executed in template preview
Environment
Jmix version: 1.7.1
Bug Description
Support forum discussion: topic.
If the user add a link with the following attribute: href="javascript:alert('1')", it will be executed in the Email Template preview.
Note that in Jmix 2.x by default HTML files are not opened in the web browser but downloaded.
Steps To Reproduce
- Add email template add-on
- Launch the application
- Create template, add "link" element
- Edit code of template and add
href="javascript:alert('1')"to the link. - Click on preview button
- In the opened tab click on the link.
Current Behavior
The JS executed within Jmix application:
Expected Behavior
The JS code should not be executed within Jmix application. The HTML can be downloaded or we should sanitize HTML.
For future assignee: create an issue for 2.x