[policy, no patch] Secondary subdomain for viewing oEmbed content is confusing and pointless

Created on 14 April 2021, over 3 years ago
Updated 23 April 2023, over 1 year ago

Problem/Motivation

This issue is spun off from the pile-on happening in ✨ [PP-1] Validate alternate domain for oEmbed iFrame Postponed .

When the oEmbed system was added to the core Media module, one of the protections added against malicious JavaScript was the suggestion that site owners configure their Drupal site to be visible through a subdomain alias (basically, oembed.example.com == example.com) so that malicious JavaScript served from an oEmbed provider would have an additional hoop to jump through. We felt strongly enough about this measure that, if oEmbed content is not served in a subdomain, we display a warning on the status report page.

However, this is tricky to set up -- it's poorly documented and the warning drives site builders crazy (as evidenced by discussion in ✨ [PP-1] Validate alternate domain for oEmbed iFrame Postponed ) until they get it set up properly. And even when they do, it's not clear that there is actually a security improvement here.

  1. If a subdomain is used, browsers consider it to be part of the main site, so it can share cookies with the main domain.
  2. If a completely different domain is used instead of a subdomain, users can go directly to the second domain, which, because it is the same Drupal site, is configured to use itself as the iFrame domain.

The oEmbed specification recommends that the HTML within the iFrame be hosted on another domain. The intention is for the HTML within the iFrame to be entirely separate from the main site. It does not recommend using a subdomain, or that the entire site be accessible from the other domain.

Steps to reproduce

Install the Standard profile and the Media module, then visit the status report page.

Proposed resolution

  1. Do not allow login from the iFrame domain. If there is not an iFrame domain, use a data URL and sandbox attribute to minimize the possibility of cookies leaking into the iFrame.
  2. Provide detailed documentation for site builders.

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

📌 Task
Status

Active

Version

10.1 ✨

Component
Media  →

Last updated about 9 hours ago

Created by

🇺🇸United States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany IT-Cru Munich

    As 3. point in proposed resolution also avoid display of duplicate content of your Drupal site is a very critical SEO related issue, when settings this up in a right way.

  • 🇬🇧United Kingdom adamps

    I've made two edits that I would appreciate comments/feedback on from the community:

    1) I propose that ASAP we should remove the existing warning. It has likely wasted 1000s of hours of site builder and developer time trying to follow the instructions, which a very low likelihood of actually providing anyone with any protection at all. It's so complex to do correctly and so lacking in documentation that I doubt even 1% of those who try do it succeed; they might even introduce security bugs by doing it incorrectly.

    2) I have expanded the proposed resolution to automatically take care of as many aspects of the solution as possible to give site builders the best possible chance of getting it working.

  • 🇪🇸Spain tunic Madrid

    Feedback on #19:

    1) I fully agree removing the warning. I spent hours myself trying to solve that warning without luck.

    2) Full fix description sounds reasonable sounds reasonable but I don't know all the nuances of cookie behavior so I can't have a strong opinion.

  • 🇦🇺Australia pameeela

    Discovered this issue while looking into this warning, which I have seen and ignored hundreds of times, in light of Starshot.

    After reading through this and ✨ [PP-1] Validate alternate domain for oEmbed iFrame Postponed I totally agree that the warning should be removed given that 1) it's extremely difficult to implement and 2) of dubious value. I understand that it's a recommendation but as it stands this feels like Drupal saying "This is a potential thing that you should maybe worry about, and we can't help you but we told you so now it's on you". In other words, very un-Drupal!

    What do we need to do to get a decision on this?

  • 🇬🇧United Kingdom longwave UK

    Discussed with @xjm at Drupalcon Barcelona. As this policy needs review, I'm marking this needs review - so far we haven't heard any opposing voices that want to keep this feature, but I will raise this with the rest of the security team and give them chance to comment here.

  • ivnish Kazakhstan

    I propose that ASAP we should remove the existing warning too. +1

  • 🇧🇾Belarus krakenbite

    +1 too. Please remove it

  • 🇪🇸Spain marcoscano Barcelona, Spain

    +1 for removing. Folks that know how to fix it probably don't need the reminder.

  • 🇭🇺Hungary mxr576 Hungary

    The outcome of this issue could make the following one "closed, won't fix".

  • 🇬🇧United Kingdom longwave UK

    I discussed this issue with @mcdruid. Some notes from the discussion:

    • Injected JavaScript cannot steal session cookies if the httpOnly flag is correctly applied to those cookies which mitigates some possible attacks.
    • It is possible to harden iframes with the sandbox attribute, which WordPress apparently does: https://core.trac.wordpress.org/ticket/44400 - however this may break existing embeds in some cases so will require testing.
    • Credentialless iframes look like a possible future solution, but they are not yet supported in Firefox or Safari.

    We agreed that this could be broken into three issues:

    1. Remove the warning message, given the difficulty to implement the suggestion and the lack of documentation on how to actually do it.
    2. Experiment with adding the sandbox attribute to the OEmbed iframe
    3. If #2 succeeds, remove the alternate domain setting
  • Status changed to RTBC 30 days ago
  • 🇦🇺Australia pameeela

    Was reminded of this today and decided to try to move it along. Updated ✨ Expose a way to suppress oEmbed security warnings Active to be about removing the warning as the first step in #27.

    I think this policy issue can be fixed?

  • 🇳🇱Netherlands Martijn de Wit 🇳🇱 The Netherlands

    Maybe we can convert this issue to a meta ticket holding all suggested child tickets?

  • 🇦🇺Australia pameeela

    Since this is a policy issue, I think it should be marked fixed once the policy is agreed. It should be referenced in the follow up issues.

  • 🇦🇺Australia pameeela

    Created a follow up for the sandbox experimentation.

  • 🇦🇺Australia pameeela
  • 🇦🇺Australia pameeela

    Crediting @lauriii for discussion in person in Singapore.

  • 🇦🇺Australia pameeela
  • 🇫🇮Finland lauriii Finland
  • 🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺
  • 🇬🇧United Kingdom longwave UK

    Adding credit for @mcdruid for discussing with me and raising some of the points mentioned in #27.

Production build 0.71.5 2024