Support

Admin Tools

#33599 Joomla 3.9.21 post-install message about htaccess

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
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Monday, 28 September 2020 01:17 CDT

jjst135

After installing Joomla 3.9.21 we see a p post-installation message from Joomla saying this has been added to the default htaccess file:

<FilesMatch "\.svg$">
  <IfModule mod_headers.c>
    Header always set Content-Security-Policy "script-src 'none'"
  </IfModule>
</FilesMatch>

Is this protection also added to the htacces by the Admin Tools htaccess maker? Or is this already npart of the XSS protection Admin Tools offers?

 

Kind regards,
Jip

nicholas
Akeeba Staff
Manager

We do not recommend adding this to your .htaccess.

It is only relevant if you allow untrusted users to upload SVG files which are going to be used in EMBED (not IMG) tags. Joomla does not allow uploading of SVG files by default.

Furthermore, the upcoming Joomla 4 has its own Content Security Policy (CSP) management tool. If that code is in your .htaccess the Joomla 4 CSP tool's settings will not be applied which can be a bigger security issue than the very rare case that you allow untrusted users to upload malicious SVGs which you explicitly put in EMBED tags on older browsers to execute their JavaScript.

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!

jjst135

OK thanks Nicolas. I do think it's a bit weird that Joomla recommends we add this and you recommend not to add this. And also if this is going to cause an issue in Joomla 4, why would Joomla recommend adding this at this stage?

Anyway, we will just use the htaccess generated bij AdminTools (as always) and I will trust your expertise / judgement. 

nicholas
Akeeba Staff
Manager

Their recommendation tries to cover all bases, even though the attack vector is extremely unlikely and requires explicitly misconfiguring your site.

While I plan on making it an option in the next version of Admin Tools I don't think it's something that all (or even the vast majority) of sites need. If you really have a site allowing untrusted users to upload SVGs and you have a scenario where a Super User could be duped into opening a potentially malicious SVG file in their browser while logged in to the site's backend you might want to add that code into your .htaccess. But, seriously, this is not an attack vector I'd lose sleep over. The rule of thumb is: if you don't absolutely trust the source of an SVG file don't open it, don't use it, delete it immediately. Same as with any other executable file.

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!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

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!