Skip to content

Wistia embeds using oEmbed suddenly broken #78768

Closed

Description

@fionchadd

Description

I have a website with a number of videos embedded from Wistia. Recently all the ones embedded using oEmbed have broken, instead showing a blurry placeholder image.

This error appears in the console: Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.

I think it's related to this pull request: #77212

I'm unsure whether this is something that needs reporting here or to Wistia directly. From reading through the pull request it sounds like the allow-same-origin flag has been removed for security reasons, and the pull request says "A new allowSameOrigin boolean prop (default false) controls the iframe's isolation level" but I'm not sure whether I can set that to true within my site, or whether it's something Wistia needs to do at their end?

Step-by-step reproduction instructions

Create a new post.
Paste a link to a Wistia video in the post content area, e.g. https://financeconnect.wistia.com/medias/vop0tim0lp
Video does not display either in the admin area or on the front end, instead showing a blurry thumbnail.

It can be seen on the live site here: https://finance-connect.com/fca-redress-scheme-clarity-at-last-but-real-test-is-delivery/

Screenshots, screen recording, code snippet

Image Image

Environment info

  • WordPress version 7.0.
  • Gutenberg not installed.
  • The site uses a custom theme based on Underscores but the issue is also present using the Twenty TwentyFive theme, and with all plugins deactivated.
  • The issue is present in all browsers and on all devices.

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] Bug
    on May 28, 2026
  2. talldan commented on May 28, 2026

    @talldan
    Contributor
  3. added
    [Block] Embed
    on May 28, 2026
  4. alecgeatches commented on May 28, 2026

    @alecgeatches
    Contributor

    @fionchadd I checked your link and I'm seeing this error on the front-end page:

    Uncaught DOMException: Window.localStorage getter: Forbidden in a sandboxed document without the 'allow-same-origin' flag.
        a https://fast.wistia.net/assets/external/E-v1.js:1
        u https://fast.wistia.net/assets/external/E-v1.js:1
        a https://fast.wistia.net/assets/external/E-v1.js:1
        ...
    

    #77212 should only apply to embeds rendered within the post editor:

    Note that this only affects script previewing within the editor. Front-end script behavior remains unmodified.

    It's possible that there still could be a problem here from the Gutenberg end, but it seems like the Wistia script is hitting a different issue on the front-end unrelated to the recent oEmbed changes in the editor.

  5. fionchadd commented on May 29, 2026

    @fionchadd
    Author

    @alecgeatches ah thank you for the clarification! I’d missed the bit in that pull request about it only affecting the back-end. I’ll push Wistia to look into it from their end.

  6. fionchadd commented on Jun 1, 2026

    @fionchadd
    Author

    @alecgeatches Hi Alec, I've heard back from Wistia who say they don't add the "sandbox" attribute to the embed themselves, and they think this is being added by WordPress, in which case the "allow-same-origin" flag also needs to be added by WordPress in order for the embed to work correctly.

    I know you said the 77212 change should only apply to embeds rendered within the post editor, but these Wistia embeds did previously work on our WordPress site and have only recently stopped working. Have there been any other changes to the embed block that you know of that may have caused this? & is there any way for me to reintroduce the "allow-same-origin" flag or can you let me know how to change the allowSameOrigin boolean from false to true?

    Thanks
    Hannah

  7. Mustafabharmal commented on Jun 1, 2026

    @Mustafabharmal
    Contributor

    Hi! I've investigated this issue and identified the root cause. WordPress core's wp_filter_oembed_result() adds sandbox="allow-scripts" to iframes from untrusted oEmbed providers (Wistia is not in WordPress's trusted provider list). In the editor, this sandboxed HTML is rendered inside the SameOriginSandBox component. The inner Wistia iframe's explicit sandbox="allow-scripts" attribute overrides the outer sandbox's allow-same-origin, giving the inner iframe a null origin and blocking localStorage.

  8. fionchadd commented on Jun 1, 2026

    @fionchadd
    Author

    Hi @Mustafabharmal - thank-you, that's very helpful! I did follow Wistia's instructions in terms of adding it as an oEmbed provider, so I have this code in the functions.php file of my theme:
    wp_oembed_add_provider('https://.wistia.com/', 'https://fast.wistia.com/oembed');

    Should that negate the issue, or is there something else Wistia need to do at their end to ensure that their videos embed correctly?

  9. Mustafabharmal commented on Jun 1, 2026

    @Mustafabharmal
    Contributor

    Hey @fionchadd, I checked this further and found that most of the Wistia videos are working fine as expected. The issue seems to be specific to this particular video/account configuration rather than the block or any WordPress code changes.

    I noticed that this embed is being rendered differently compared to the working Wistia embeds, which usually happens when the video has some privacy or embed restrictions enabled in Wistia.

    Could you please check the Wistia video/account settings for things like:

    • Domain restrictions
    • Private/Protected embeds
    • Secure sharing settings
    • Any embed restrictions or authentication requirements

    I suspect one of these configurations is causing the issue.

  10. fionchadd commented on Jun 2, 2026

    @fionchadd
    Author

    @Mustafabharmal Ah thank you so much for checking other Wistia videos, that's very helpful to know that other embeds are working as normal. I'll dig further into our configuration to work out what the issue is, but it doesn't sound like a WordPress bug in that case.

    Thanks so much for your help troubleshooting this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Embed[Type] Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions