Support

Admin Tools

#39201 x-frame Options

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.3.3
PHP version
8.0.29
Admin Tools version
7.3.4

Latest post by Doomster on Monday, 17 July 2023 12:00 CDT

Doomster

Hello,

My primary site carries my demos script for template/component demos, and my demos sight sets on another domain (https://www.dleproducts.xyz).  Just updated it to J4 and am putting new demos on and 2 of them work but one will not show (https://www.demo.dleproducts.xyz/residential) in my demos frame (https://www.dlejproducts.pro/demos/?theme=Residential).
My question is, is there a way that I can add the allow from https://dlejproducts.pro to the x-frame options through the htaccess if that still works with the current browsers?

Thank you in advance for your suggestions.

tampe125
Akeeba Staff

Hello,

can you please check the value of the option "Protect against clickjacking"? Can you please set it to No?

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Doomster

Thank you,

I tried this at one point but it has no effect. Still getting the error "Refused to display 'https://www.demo.dleproducts.xyz/' in a frame because it set 'X-Frame-Options' to 'sameorigin'."

tampe125
Akeeba Staff

Where did you perform the change? On the website that holds the iframe or the one that is inside the iframe?

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Doomster

I actually have it off on both of the domains.

tampe125
Akeeba Staff

Just to be sure, can you please try to replace your current .htaccess file with Joomla default one and disable Admin Tools on both the website?

Do you still have the same issue?

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Doomster

Hello,

This had no effect either, still the same issue.  I thought I could add products.pro domain to the htaccess in x-frame options to allow it.

Appreciate your help.

nicholas
Akeeba Staff
Manager

You have two sites. The one you want to display inside an IFRAME we will call the Guest. The one which has the IFRAME element we'll call the Host.

The Guest site can control whether it wants to be displayed inside an IFRAME using the X-Frame-Options header. If that site runs on Joomla!, and you're using Admin Tools' .htaccess Maker on it you have to set Protect Against Clickjacking to No.

When you try to display a site with X-Frame-Options: SAMEORIGIN or X-Frame-Options: DENY the browser will refuse to display the site in an IFRAME and will print out an error in the developer tools. Safari prints "Refused to display 'such and such URL' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'."

This is exactly your problem. The browser tells me that it cannot load https://www.demo.dleproducts.xyz/residential/ because it set 'X-Frame-Options' to 'SAMEORIGIN'. Therefore, you need to disable "Protect Against Clickjacking" on www.demo.dleproducts.xyz to No.

Now, for completeness' sake and because this is a public ticket other people will be reading, let me talk about the Host side as well.

The Host site can also control which sites it allows to be rendered inside IFRAMES (or not at all) using the Content-Security-Policy header (also referred to as CSP). This is where things get hairy — or, to use a more pedestrian phrase, where the shit hits the fan. The CSP is an extremely powerful feature. It's also maddeningly hard to set up right. It has two features, frame-src (which pages can appear inside IFRAMEs) and frame-ancestors (which pages of the Host site can have IFRAMEs).

Admin Tools DOES NOT deal with Content-Security-Policy of Joomla–generated pages because it's such a convoluted topic. If you are using Joomla and Admin Tools' .htaccess Maker on that site please check if you have put any custom Header lines in the custom .htaccess code areas of your site which set the Content-Security-Policy header. If you have, try commenting them out (placing a # in front).

Also remember that Joomla itself can set the CSP header with the System - HTTP Headers plugin — which I have repeatedly called a Bad Idea™ long before Joomla 4.0 was released. If you have enabled that plugin, try disabling CSP (third tab) and check if there are any custom Content-Security-Policy headers (first tab) you may additionally have to remove.

I do not see any sign of this problem on your www.dlejproducts.pro site. The headers returned by your server do not include a Content-Security-Policy at all.

I hope this helped.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Doomster

Hello,

Thank you very much for the details you have given me.

Thank you all for the time.

Doomster

Hello,

I have it working fine, now.
Thank you for elaborating on the subject it led me in the right direction.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!