XSS Vulnerability in Live Preview
Well if you use GrapesJS and allow the possibility to insert custom HTML, yes, Self-XSS is possible. Unfortunately, there are few issues that do not allow me to fix this properlyI need to access the iframe's DOM in order to add/update inner components so, the editor won't work without sandbox="allow-same-origin".Runni...
Read full answer below ↓Question
Version: 0.16.22
Are you able to reproduce the bug from the demo?
[ x] Yes
Steps:
- Click Import HTML
- Insert
<img src="any_image_source.gif" onload="alert(1)"/> - The JS will be executed
Having proper "sandbox" attribute on iframe could probably mitigate the problem.
Answers (3)
Well if you use GrapesJS and allow the possibility to insert custom HTML, yes, Self-XSS is possible. Unfortunately, there are few issues that do not allow me to fix this properlyI need to access the iframe's DOM in order to add/update inner components so, the editor won't work without sandbox="allo...
You are right, we thought sandbox="allow-same-origin" will do the job, but allow-scripts is also needed, and then it's like not using sandbox at all. But, what could be helpful anyway is to provide a way for grapejs users to somehow control attributes of the iframe canvas - that way they can take t...
if you use content security policy http header you can get around a lot of XSS issues like this. but there is one issue with GrapesJS atm which is that it uses underscore.js, which includes a function with use of "eval" so you can't make the CSP header as secure as it should be
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1295
[Bug]: Unit select field missing on IE after click
@artf I'm currently using GrapesJS latest version (but you can reproduce this bug using the demo). Basically all you have to do is select a...
Issue #3045
BUG: Problem importing CSS and module in nodejs es6
Version: 0.16.22 Are you able to reproduce the bug from the demo? [x] Yes [ ] No What is the expected behavior? To import grapejs css and m...
Issue #2843
[BUG] Can't remove style property on selected device
Hi, have a problem with removing style property on selected device (clearProperties: true). You can reproduce the problem on https://grapes...
Issue #3048
[BUG]: TypeError: Cannot read property 'get' of undefined
Version: 0.16.22Are you able to reproduce the bug from the demo? [x] Yes [ ] NoWhat is the expected behavior? no errors in the console.Desc...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.