?
avatar PhilETaylor
PhilETaylor
16 Jun 2020

Steps to reproduce the issue

Joomla 4 admin load a url like:

http://127.0.0.1:8400/administrator/index.php?option=com_content&view=articles

note that looks like unicorns and rainbows love it to bits.

Append &tmpl=component

note that looks like unicorns and rainbows love it to bits.

Make a typo in &tmpl=component like

http://127.0.0.1:8400/administrator/index.php?option=com_content&view=articles&tmpl= MadeUpName

Expected result

Error message saying that MadeUpName is not a valid value for tmpl

Actual result

Screenshot 2020-06-16 at 23 19 33

Note

edit: Joomla 3 affected too it seems

avatar PhilETaylor PhilETaylor - open - 16 Jun 2020
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jun 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Jun 2020
avatar ReLater
ReLater - comment - 16 Jun 2020

If a tmpl (=> tmpl.php) doesn't exist inside the current template folder the rendering falls back to template system. If the tmpl.php doesn't exist in that folder the rendering falls back to system/index.php which includes system/component.php.

It's the same behavior like in Joomla 3. Front-end and back-end.

avatar PhilETaylor
PhilETaylor - comment - 16 Jun 2020

So the fix then is to validate the value against valid filenames and remove the final fall back to system/index.php ?

A B/C break for sure, so best done now at Joomla 4.0.0 ?

or a complete won't fix by not adding any validation to user supplied input?

avatar ReLater
ReLater - comment - 16 Jun 2020

I don't know...

For the sake of completeness, the last two fallback steps:
https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Document/HtmlDocument.php#L699-L733

avatar PhilETaylor
PhilETaylor - comment - 16 Jun 2020

Well at least the user supplied value is having some security filtering on it before being used as a file name ;-) ;-)

avatar PhilETaylor PhilETaylor - change - 17 Jun 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-06-17 09:22:20
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - close - 17 Jun 2020

Add a Comment

Login with GitHub to post a comment