You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.
The current implementation of the playground allows users to execute arbitrary code in a given window which can lead to XSS attacks. We can prevent this by executing the preview code inside an iframe, this way XSS attacks are prevented due to browsers same origin policy.
To fix this, with the current implementation, we would have to figure out a way to mount the Preview Component on an iframe. We could either try to incorporate an existing package, like react-frame-component to the Preview component or emulate the package by using portals and updating the Preview component life cycle.
I am happy to make a PR with this change and make the web a little safer while at it 🙂
The text was updated successfully, but these errors were encountered:
The current implementation of the playground allows users to execute arbitrary code in a given window which can lead to XSS attacks. We can prevent this by executing the preview code inside an iframe, this way XSS attacks are prevented due to browsers same origin policy.
To fix this, with the current implementation, we would have to figure out a way to mount the
Preview
Component on an iframe. We could either try to incorporate an existing package, like react-frame-component to thePreview
component or emulate the package by using portals and updating thePreview
component life cycle.I am happy to make a PR with this change and make the web a little safer while at it 🙂
The text was updated successfully, but these errors were encountered: