Sandbox iframes to make them secure

Created on 30 May 2025, 3 months ago

Overview

https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ifr...

- Use the sandbox attribute on our current iframe usages
- Convert any existing cross-frame communications to use postMessage()

Proposed resolution

User interface changes

📌 Task
Status

Active

Version

0.0

Component

Code

Created by

🇺🇸United States hooroomoo

Live updates comments and jobs are added and updated live.
  • Security

    It is used for security vulnerabilities which do not need a security advisory. For example, security issues in projects which do not have security advisory coverage, or forward-porting a change already disclosed in a security advisory. See Drupal’s security advisory policy for details. Be careful publicly disclosing security vulnerabilities! Use the “Report a security vulnerability” link in the project page’s sidebar. See how to report a security issue for details.

Sign in to follow issues

Comments & Activities

  • Issue created by @hooroomoo
  • 🇺🇸United States effulgentsia

    Editing the JS code of code components requires a restrict access permission, so using non-sandboxed iframes for the various previews isn't a vulnerability, but sandboxing them would help add extra defense against some privilege escalation vectors, so switching the tag from Security to "Security improvements".

    However, I'm still tagging this as a beta blocker as well, because we want early adopters able to run the beta in production, and this would help provide extra confidence for doing so.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Agreed!

  • 🇺🇸United States effulgentsia

    I discussed this with @lauriii and we decided that people running beta1 in production can be judicious about to whom they give the permission. It would be nice to get this resolved early in the beta cycle but we don't have to block beta1 on it.

  • 🇺🇸United States effulgentsia

    We're not targeting this for beta anymore. I'd still like to resolve it relatively soon after beta1, but the "stable blocker" tag plus Critical priority is enough to keep this on our radar for that.

  • 🇫🇮Finland lauriii Finland

    Moving this to stable target because it is possible to start getting adoption especially with smaller sites prior to having this.

Production build 0.71.5 2024