Allow mattermost inside an iframe, in a controlled way
This pull request introduced a security measure to protect against clicjacking attacks: https://github.com/mattermost/platform/pull/253
But it also prevents some legitimate uses of iframes. For example, Nextcloud has a "external sites" function to run any app as if it was a Nextcloud app, by putting it in an iframe inside Nextcloud (https://docs.nextcloud.com/server/9/admin_manual/configuration_server/external_sites.html).
My proposal is to add some settings to allow an authorized domain, and then change X-Frame-Options, instead of DENY put ALLOW-FROM this domain. And to check the domain also in the javascript check in head.html.
This way it would allow legitimate uses, while still protecting against clickjacking attacks.
![](https://secure.gravatar.com/avatar/2ffb2a7fa9da35b1dfff3656c3f6d0ef?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
Malek commented
Hey Andrés,
Which file did you change from DENY to ALLOW-FROM.
I cant find head.html or even context.go.Thank you.
-
Jim Whitescarver commented
We need this to run mattermost in our portals for diglife.com across mattermost instances.