Problem/Motivation
See https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Stru... under the "Always use the sandbox attribute" sandbox:
Always use the sandbox attribute
You want to give attackers as little power as you can to do bad things on your website, therefore you should give embedded content only the permissions needed for doing its job. Of course, this applies to your own content, too. A container for code where it can be used appropriately — or for testing — but can't cause any harm to the rest of the codebase (either accidental or malicious) is called a sandbox.
Content that's not sandboxed may be able to execute JavaScript, submit forms, trigger popup windows, etc. By default, you should impose all available restrictions by using the sandbox attribute with no parameters, as shown in our previous example.
If absolutely required, you can add permissions back one by one (inside the sandbox="" attribute value) — see the sandbox reference entry for all the available options. One important note is that you should never add both allow-scripts and allow-same-origin to your sandbox attribute — in that case, the embedded content could bypass the Same-origin policy that stops sites from executing scripts, and use JavaScript to turn off sandboxing altogether.
Note: Sandboxing provides no protection if attackers can fool people into visiting malicious content directly (outside an iframe). If there's any chance that certain content may be malicious (e.g., user-generated content), please serve it from a different domain to your main site.
Comments
Comment #2
anybodyMaybe we should make this a setting, enabled by default? So the site manager can control it.
Comment #3
anybodyYeah maybe we even need a further setting for the optional contents of the attribute (just a textfield)?
Comment #5
grevil commentedWe are not generating the iframes in this module. This module simply provides content to render inside iframes by third party sites.
I created information noticing the user about the usage of "sandbox" in the README file.